How to convert a list in the variable into a cell array
古いコメントを表示
I have a list of names set as a variable and I would like to know how you can make that list into a cell array without typing each one out
for example my list
val=
ABC
DEF
GHK
can i make/convert that into an array without typing each one out like list={'ABC','DEF','GHK'} thanks
1 件のコメント
Azzi Abdelmalek
2013 年 3 月 24 日
It should be ABC DEF GHI
回答 (2 件)
Azzi Abdelmalek
2013 年 3 月 24 日
編集済み: Azzi Abdelmalek
2013 年 3 月 24 日
out=cellstr(reshape('A':'I',[],3)')'
3 件のコメント
Jayden Deng
2013 年 3 月 24 日
Jayden Deng
2013 年 3 月 24 日
Azzi Abdelmalek
2013 年 3 月 24 日
編集済み: Azzi Abdelmalek
2013 年 3 月 24 日
If there is not any pattern, you have to enter them manually, then use reshape function
Walter Roberson
2013 年 3 月 25 日
0 投票
If the variable is currently a char array, then use cellstr() to convert to a cell array.
カテゴリ
ヘルプ センター および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!