how can i convert the content of a character array to a variable name

5 ビュー (過去 30 日間)
AA
AA 2020 年 3 月 29 日
回答済み: David Hill 2020 年 3 月 29 日
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?

採用された回答

David Hill
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 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by