MATLAB Answers


Is it possible to convert symfun to sym?

Asked by Josh McCaffrey on 1 Apr 2015
Latest activity Commented on by Jawad Bdour on 13 Dec 2018
I have a variable x that is of class symfun and I want to convert it to class sym. Unfortunately I can't post the code because there are a ton of custom functions. I found that the code x=x(1,1) works when x is a two dimensional vector but that is not always the case.


Sign in to comment.

1 Answer

Answer by Christopher Creutzig on 20 Nov 2017

Symfun is a subclass of sym, so, yes, a symfun is already a sym.
To get only the body of the function, use formula or call the symfun:
syms x(t)
x(t) = t^2 - t;
% or:

  1 Comment

Thank you very much, your answer really helped me!

Sign in to comment.