Is it possible to convert symfun to sym?

79 vues (au cours des 30 derniers jours)
Josh McCaffrey
Josh McCaffrey le 1 Avr 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.

Réponse acceptée

Christopher Creutzig
Christopher Creutzig le 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;
formula(x)
% or:
x(t)
  2 commentaires
Jawad Bdour
Jawad Bdour le 13 Déc 2018
Thank you very much, your answer really helped me!
José Lindoro Fonseca Fierro
It really helped me a lot! Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Formula Manipulation and Simplification dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by