find out dependent variables from an expression
Ältere Kommentare anzeigen
syms x(t)
y=x^2+2;
symvar(y)
It gives the ans as t.
Desired output is x. How to get the desired output.
Thanks in advance
Akzeptierte Antwort
Weitere Antworten (1)
syms x
y=x^2+2;
symvar(y)
2 Kommentare
Arpan Laha
am 5 Apr. 2022
Cris LaPierre
am 5 Apr. 2022
Then the symvar is t, as you see. symvar returns symbolic variables in an expression. As you have set it up, x and y are symbolic functions, not variables. t is the only symbolic variable.
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!