MATLAB: How to use Permute

permute

Hello,
I have a matrix A(2362×48) and I want to convert this into a 3D matrix B(2362X12X4). So I want all the rows of columns 1:12 of matrix A to be in B(:,:,1) and all rows of columns 13:24 of A in B(:,:,2) etc. Can anyone help me with this? I tried permute but get different matrices all the time..

Best Answer

reshape(A,size(A,1),12,4)