Convert cell array of cell arrays to matrix of matrices
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I can convert a cell array of matrices to matrix: >> C={[1,1]; [2,2]; [3,3]}; >> cell2mat(C) ans = 1 1 2 2 3 3 This is OK. But, I want to convert a cell array including other cell arrays to a matrix: >> C={{1,1}; {2,2}; {3,3}}; >> cell2mat(C) Error using cell2mat (line 53) Cannot support cell arrays containing cell arrays or objects. So, desired output is: >> mycell2mat({{1,1}; {2,2}; {3,3}}) ans = 1 1 2 2 3 3 How to do this? Edit: I want to do same thing for multidimensional ones also: >> mycell2mat({{1,1;1,1}; {2,2;2,2}; {3,3;3,3}}) ans(:,