Is it possible to convert symfun to sym?

74 ビュー (過去 30 日間)
Josh McCaffrey
Josh McCaffrey 2015 年 4 月 1 日
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.

採用された回答

Christopher Creutzig
Christopher Creutzig 2017 年 11 月 20 日
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 件のコメント
Jawad Bdour
Jawad Bdour 2018 年 12 月 13 日
Thank you very much, your answer really helped me!
José Lindoro Fonseca Fierro
José Lindoro Fonseca Fierro 2019 年 11 月 21 日
It really helped me a lot! Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFormula Manipulation and Simplification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by