How to convert a list in the variable into a cell array
Ältere Kommentare anzeigen
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 Kommentar
Azzi Abdelmalek
am 24 Mär. 2013
It should be ABC DEF GHI
Antworten (2)
Azzi Abdelmalek
am 24 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 24 Mär. 2013
out=cellstr(reshape('A':'I',[],3)')'
3 Kommentare
Jayden Deng
am 24 Mär. 2013
Jayden Deng
am 24 Mär. 2013
Azzi Abdelmalek
am 24 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 24 Mär. 2013
If there is not any pattern, you have to enter them manually, then use reshape function
Walter Roberson
am 25 Mär. 2013
0 Stimmen
If the variable is currently a char array, then use cellstr() to convert to a cell array.
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!