How does symvar work?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Paulo Silva
am 7 Jun. 2011
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 Kommentare
Paulo Silva
am 9 Jun. 2011
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!