string to sym error
1 次查看(过去 30 天)
显示 更早的评论
I have the string
>> d='1/m'
>> class(d)
char
>> p=sym(d)
I get:
Warning: Support of strings that are not valid variable names or define a number will be removed in a future relase. To create symbolic expressions, firs create symbolic variables and then use operations on them.
after that p is empty
I tried syms m; at the beginning but i get the same error
0 个评论
采纳的回答
Mischa Kim
2016-9-19
Alberto, the functionality you are using will be removed in future releases, but you can still use it. That is why you are getting a warning message (not an error message).
Instead use,
syms m
p = 1/m
2 个评论
Richard Wang
2016-10-24
but if I do need to convert a string to symbolic expression, how can I realize it, since this sym() function will no longer in use?
For example, I want to type in an expression by keyboard input and I want to treat this expression as symbolic function or other.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Variables, Expressions, Functions, and Preferences 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!