MATLAB: How to replace the elements of a matrix with other matrix

alirahiminezhad123@yahoo.com

i want a=[0 2 4 6;1 3 5 7;8 10 12 14;9 11 13 15] convert to b=[0 1 2 3;4 5 6 7;8 9 10 11; 12 13 14 15]
how can built b?
tanks a lot plz help me

Best Answer

reshape(permute(reshape(a,[2 1 2 4]),[1 4 2 3]),4,[]).'