variable to output name
显示 更早的评论
name = 'adams'
c = 2x+4
I would like the value of "name" to be the variable for c. Therefore, instead of:
c = 2x+4
it would be:
adams = 2x+4
5 个评论
Azzi Abdelmalek
2013-11-1
Can you explain?
Leyon
2013-11-1
dpb
2013-11-1
Don't do this, use dynamic field names instead...
Leyon
2013-11-1
It isn't the only option, but I recommended it to you here
as the safest one. There are dangers in using assignin, eval, load, etc... to create variables inexplicitly. See, for example,
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Variables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!