MATLAB: Converting 2D Array to 3D

2d to 3d array conversionpermutereshape

How can I convert a 2D array to a 3D array in the following form?

Best Answer

permute(reshape(A,I/3,[],J),[1,3,2]) % A - matrix, I - no of rows, J - no of columns