フィルターのクリア

How to split string with commas to columns?

15 ビュー (過去 30 日間)
Kelly Kyriakou
Kelly Kyriakou 2015 年 11 月 28 日
コメント済み: Star Strider 2015 年 11 月 28 日
How to split thsi string to columns with delimiter the comma? '10009_10383,195,1.73936,0.54069,0.579311,56,0,0,0,0,0,0,0,0,0,0,0,0,'
I tried strsplit but I receive the following error 'First input must be a string.'

採用された回答

Star Strider
Star Strider 2015 年 11 月 28 日
One possibility:
in = '10009_10383,195,1.73936,0.54069,0.579311,56,0,0,0,0,0,0,0,0,0,0,0,0,';
out = regexp(in, ',', 'split');
out = out(1:end-1)
out =
'10009_10383' '195' '1.73936' '0.54069' '0.579311' '56' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0'
Note that ‘out’ is a (1x18) cell.
  2 件のコメント
Kelly Kyriakou
Kelly Kyriakou 2015 年 11 月 28 日
Thank you very much!
Star Strider
Star Strider 2015 年 11 月 28 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by