MATLAB: Split a matrix into smaller pieces – help

MATLABmatrix manipulationreshape

Hi guys, I have a 16×36 matrix and I want to divide it into 4×36 submatrixes. I used reshape(matrix,4,[],4) but the order of elements got wrong. Any ideas?
Best regards,

Best Answer

A = reshape(1:36*16,16,36);
B = mat2cell(A,[4 4 4 4],36);
Now you have each submatrix stored in a cell of B. For example, B{1} is:
B{1}