Convert cell array of cells into cell array of strings in MATLAB
- by yuk
Using regexp with tokens on cell array of strings I've got cell array of cells. Here is simplified example:
S = {'string 1';'string 2';'string 3'};
res = regexp(S,'(\d)','tokens')
res =
{1x1 cell}
{1x1 cell}
{1x1 cell}
res{2}{1}
ans =
'2'
I know I have only one match per cell string in S. How I can convert this output into cell arrays of strings in a vectorized form?