convert character array to cell
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I'm trying to generate a file list using a system command.
[status ,out]=system('dir mat')
The format of the variable is in char format. How can I save this in a cell, to display each line in a new row of the cell.
0 件のコメント
採用された回答
AJ von Alt
2014 年 8 月 6 日
You can use strsplit to split the string into cells. For your output, you can use the line feed character char(10) as the delimiter, so a new cell is created for each new line.
out_cell = strsplit(out,char(10))';
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で String についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!