MATLAB: Convert char to multiple cells, each cell takes one string

cellcellstrchar

I have a 1*121 char 'Runtime_Cur','Runtime_Prev','Id_Cur','Id_Prev','Description','PNL','PNL_Cur','valuedate_Cur','PNL_Prev','valuedate_Prev'
cellstr gives me a 1*1 cell, but I would like to get a 1*10 cell, each cell contains one string, so it will be: {'Runtime_Cur','Runtime_Prev','Id_Cur','Id_Prev','Description','PNL','PNL_Cur','valuedate_Cur','PNL_Prev','valuedate_Prev'}
ans =
Columns 1 through 6
'Runtime_Cur' 'Runtime_Prev' 'Id_Cur' 'Id_Prev' 'Description' 'PNL'
Columns 7 through 10
'PNL_Cur' 'valuedate_Cur' 'PNL_Prev' 'valuedate_Prev'
Could any one help? Thanks in advance 🙂

Best Answer

Provided that the literal quote marks do not appear in the middle of a string:
STRING(STRING=='''') = [];
STRcells = regexp(STRING, ',', 'split');
Related Question