How to convert a list in the variable into a cell array
Mostra commenti meno recenti
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 Commento
Azzi Abdelmalek
il 24 Mar 2013
It should be ABC DEF GHI
Risposte (2)
Azzi Abdelmalek
il 24 Mar 2013
Modificato: Azzi Abdelmalek
il 24 Mar 2013
out=cellstr(reshape('A':'I',[],3)')'
3 Commenti
Jayden Deng
il 24 Mar 2013
Jayden Deng
il 24 Mar 2013
Azzi Abdelmalek
il 24 Mar 2013
Modificato: Azzi Abdelmalek
il 24 Mar 2013
If there is not any pattern, you have to enter them manually, then use reshape function
Walter Roberson
il 25 Mar 2013
0 voti
If the variable is currently a char array, then use cellstr() to convert to a cell array.
Categorie
Scopri di più su Cell Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!