Cell array
古いコメントを表示
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
採用された回答
その他の回答 (2 件)
Fangjun Jiang
2011 年 7 月 22 日
You mean this?
a={'xx1 xx2 xx3 xx4'};
b=regexp(a{1},'\s','split')
3 件のコメント
Jason
2011 年 7 月 22 日
Fangjun Jiang
2011 年 7 月 22 日
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
2011 年 7 月 22 日
Titus Edelhofer
2011 年 7 月 22 日
or similarly using textscan:
b = textscan('xx1 xx2 xx3 xx4', '%s');
b = b{1}
Titus
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!