MATLAB Cell转换为3D矩阵

https://ww2.mathworks.cn/matlabcentral/answers/326843-converting-cell-to-3-dimensional-matrix

Question:

I have a cell of size [1, 50] each of it is 11 x 2 matrix.
I would like it to convert it to a 3-d matrix of size 11 X 2 X 50.
How it can be done? Cane it be done using reshape?
Thanks

Answer:

If C is your cell array:

 cell2mat(permute(C,[1,3,2]))

or

 cell2mat(reshape(C,1,1,[]))

or

 cat(3,C{:})

你可能感兴趣的:(matlab,矩阵)