how can i convert the content of a character array to a variable name
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a character variable called xx=Hello.
I want to convert that xx variable to a matrix name variable named Hello.
How can I do this?
0 个评论
采纳的回答
David Hill
2020-3-29
Generally, you should not do what you are trying to do. One possible solution is to use a struct.
xx='Helo';
myStruct.(xx)=magic(5);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!