MATLAB: Changing block row matrix to block column matrix

matrix manipulation

I have a block matrix p = [A B C …]. I want to change the matrix into a column block matrix without changing the elements of inner matrices (A, B, …).

Best Answer

[EDIT]
B = 2; % the number of blocks
[m,n] = size(c);
out = reshape(permute(reshape(c,m,n/B,[]),[1,3,2]),m*B,[]);