I am trying to search a cell of cell arrays for a matching string without using a for loop due to the inefficiency and speed. My first idea was to use an anonymous function and strip out the top layer iteratively of the cell array in the form of
cellfun(@(cell) cell{1}, MyCellofCellArray, 'UniformOutput', false);
However, let's say for example I have an uneven cell of cell array where
MyCellArray{1} = 1x1 cell, MyCellArray{2} = 1x2 cell, MyCellArray{3} = 1x3 cell.
If you try to use the aforementioned cellfun, you get an error "Index exceeds matrix dimensions" because MyCellArray{1} only contains a 1×1 cell. Anyone have any ideas or suggestions?
Thanks,
JWelch
Best Answer