Convert cell array of cells into cell array of strings in MATLAB?

The problem is even worse than you thought. Your output from REGEXP is actually a cell array of cell arrays of cell arrays of strings! Yeah, three levels!

The following uses CELLFUN to get rid of the top two levels, leaving just a cell array of strings.

The problem is even worse than you thought. Your output from REGEXP is actually a cell array of cell arrays of cell arrays of strings! Yeah, three levels!

The following uses CELLFUN to get rid of the top two levels, leaving just a cell array of strings: 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{:}).

So easy. :) Thanks a lot! – yuk Apr 12 '10 at 19:34 @gnovice: You are right about those levels.

I think the second solution is better for the speed and clearness. Thanks again. – yuk Apr 13 '10 at 1:03 @gnovice: I don't know how often I have read the documentation of regexp - yet I haven't noticed the 'once' option.

Thanks! – Jonas Apr 13 '10 at 14:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions