MATLAB: I have a 10x6x5 matrix, I want to convert it into 6×50 matrix. How to do this

2d3d3d matrixmatrixmatrix manipulation

I want to keep second dimension(6 elements) data in the each column vector of the new 2d matrix and there would be 50 (10*5) such columns.

Best Answer

A = rand(10,6,5) ;
C = permute(A,[1 3 2]);
C = reshape(C,[],size(A,2),1) ;