MATLAB: Transform a 3D dimension array to n 2D matrix

3d dimension array to n 2d matrixMATLAB

How can I transform a 3D dimension array (15*781*81) to 15 extracted 781*81 2D matrix to make it feasible to write down them in different Excel files?
Cheers,
Hiua

Best Answer

result = cellfun(@squeeze, num2cell(YourArray, [2 3]), 'uniform', 0)
This will give you a 15 x 1 cell array, each entry of which is a 781 x 81 array