Is it possible to convert symfun to sym?

조회 수: 78 (최근 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 CenterFile Exchange에서 Formula Manipulation and Simplification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by