find out dependent variables from an expression
显示 更早的评论
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
采纳的回答
更多回答(1 个)
syms x
y=x^2+2;
symvar(y)
2 个评论
Arpan Laha
2022-4-5
Cris LaPierre
2022-4-5
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!