MATLAB Answers

Is it possible to convert symfun to sym?

60 views (last 30 days)
Josh McCaffrey
Josh McCaffrey on 1 Apr 2015
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.

Answers (1)

Christopher Creutzig
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:


Jawad Bdour
Jawad Bdour on 13 Dec 2018
Thank you very much, your answer really helped me!

Sign in to comment.

Sign in to answer this question.

Translated by