The problem is even worse than you thought. Your output from REGEXP is actually an array of cells of arrays of cells of arrays of cells of rows! Yes, three levels! The following actions use CELLFUN to get rid of the top two levels, leaving only an array of row cells:
cellArrayOfStrings = cellfun(@(c) c{1},res);
However, you can also change your call to REGEXP to get rid of one level, and then use VERTCAT :
res = regexp(S,'(\d)','tokens','once'); %# Added the 'once' option cellArrayOfStrings = vertcat(res{:});
gnovice
source share