How to convert a list in the variable into a cell array
Mostrar comentarios más antiguos
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 comentario
Azzi Abdelmalek
el 24 de Mzo. de 2013
It should be ABC DEF GHI
Respuestas (2)
Azzi Abdelmalek
el 24 de Mzo. de 2013
Editada: Azzi Abdelmalek
el 24 de Mzo. de 2013
out=cellstr(reshape('A':'I',[],3)')'
3 comentarios
Jayden Deng
el 24 de Mzo. de 2013
Jayden Deng
el 24 de Mzo. de 2013
Azzi Abdelmalek
el 24 de Mzo. de 2013
Editada: Azzi Abdelmalek
el 24 de Mzo. de 2013
If there is not any pattern, you have to enter them manually, then use reshape function
Walter Roberson
el 25 de Mzo. de 2013
0 votos
If the variable is currently a char array, then use cellstr() to convert to a cell array.
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!