MATLAB: Change dimension of a matrix

matrix

How to change a matrix dimension 1X131072 to 256X256

Best Answer

reshape(yourmatrix,256,256,[]);
or
permute(reshape(yourmatrix,256,256,[]),[2 1 3]);