Convert Cell to variable name array
古いコメントを表示
How can i use cell text as variable name input?
I want to use string variables "A" as variable name to output"B".
A={'sample1' 'sample 2' 'sample3'}
like this:
[B]=[sample1, sample2, sample3]
please suggest code made for 2013 matlab version.
Thanks for your help!
6 件のコメント
This is not valid MATLAB syntax:
B=(sample1,sample2, sample3)
What are you actually trying to do?
Note that using numbered variables is a sign that you are doing something wrong.
madhan ravi
2019 年 5 月 17 日
編集済み: madhan ravi
2019 年 5 月 17 日
That is obviously Python syntax for lists
edit: Looks like you have changed () to [] after I made this comment.
joms
2019 年 5 月 17 日
madhan ravi
2019 年 5 月 17 日
編集済み: madhan ravi
2019 年 5 月 17 日
The creation of those matrices are not a good idea , if the sizes are consitent use a ND array else use a cell array as is, what your doing is risky and vulnerable. Don't believe see the valuable contributions
joms
2019 年 5 月 17 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!