Symbolic vectors 'invalid variable name'
47 次查看(过去 30 天)
显示 更早的评论
Starting with a fresh MATLAB environment, the code:
syms a [1 4]
Causes an error: "Error using syms (line 222). Invalid variable name."
This code creates a 1x1 sym object 'a', but not the expected 1x4 symbolic vector. The exact same error occurs on my own computer running R2018a (academic) and university computers running R2018b (academic). The syms toolbox seems to be working fine as simply using 'syms a' works fine.
All other similar errors seem to be caused by a missing symbolic toolbox or with more complicated code. I can't figure out why something so simple is failing on both systems. Any suggestions are very welcome.
0 个评论
采纳的回答
madhan ravi
2019-4-24
sym('a',[1 4])
doc sym
2 个评论
madhan ravi
2019-4-24
编辑:madhan ravi
2019-4-24
The documentation you’re seeing is for 2019a version.
更多回答(1 个)
Nathan Hardenberg
2022-5-4
In my R2021b version your code works without an error. And the output is like one would expect:
syms a [1 4]
display(a)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!