How does symvar work?
2 次查看(过去 30 天)
显示 更早的评论
Hi all!
symvar 'cos(2*pi*t)'
How can I make symvar to not return 't'?
I use this: syms t
but no success.
0 个评论
采纳的回答
Paulo Silva
2011-6-7
symvar gives you the symbolic variables inside one expression, you say that t is symbolic so the expression symvar('cos(2*pi*t)') gives you t, I can't imagine why you don't wan't to get the t.
3 个评论
Paulo Silva
2011-6-9
t=0:0.1:10;
insertfunction='cos(2*pi*t))'
gh=symvar(insertfunction)
if (numel(gh)==1) %see if there's only one symbolic variable (just the t)
eval(['v =0*t+ ',vectorize(gh),';'])
plot(t,v)
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!