MATLAB: How to split string with commas to columns

splitstrings

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.'

Best Answer

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.