Mostrar comentarios más antiguos
If I have a cell array that consists of 1 row by n columns such as and each entry has text of the form
xx1 xx2 xx3 xx4
How can I create a single string that has each entry comma seperated. I need to create this format to enable Rowheaders for a UItable.
i.e. rowHeaders = {'xx1','xx2',xx3','xx4'};
thanks
Respuesta aceptada
Más respuestas (2)
Fangjun Jiang
el 22 de Jul. de 2011
You mean this?
a={'xx1 xx2 xx3 xx4'};
b=regexp(a{1},'\s','split')
3 comentarios
Jason
el 22 de Jul. de 2011
Fangjun Jiang
el 22 de Jul. de 2011
You mean a={'xx1' 'xx2' 'xx3' 'xx4'}? Then what processing do you need? Could you just update your question to include of your example input and output?
Jason
el 22 de Jul. de 2011
Titus Edelhofer
el 22 de Jul. de 2011
or similarly using textscan:
b = textscan('xx1 xx2 xx3 xx4', '%s');
b = b{1}
Titus
Categorías
Más información sobre File Operations 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!