MATLAB: How to convert a cell array of cell arrays to matrix

arrays on arrays

C={{'a' 3 {2 3} 6};{'b' 3 {4 5} 7}}

Best Answer

A matrix cannot contain strings. So the best you can do is convert your cell array of cells to a single cell array as long as all of your sub-cells are the same size. Here's an example of that.
reshape([C{:}],2,4)
The numbers 2 and 4 come from the length of C and length of C{1}, respectively. So the line above can be written as
reshape([C{:}],size(C,1),size(C{1},2))
assuming the length of C{1} is the same as all other C{n}.
Related Question