symbol from string [2]
显示 更早的评论
I have already posted about this ( http://www.mathworks.it/matlabcentral/answers/7220-symbol-from-string )
a='name'
syms (a)
this code generates a symbol called 'name'. If I write a function, I don't know the string before I use it, so how can I use the symbol 'name' (like symbol) into the function?
i.e
function [A]=f(a)
a='name';
syms (a)
c=cos(name);
s=sin(name);
A=c+s;
In the output I want a symbolic expression A=cos(name) + sin(name).
Thank you a lot for you answer. Pietro Rossi
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Operations on Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!