MATLAB: How to reassemble tessellated matrix

MATLABmatrix manipulation

I am able to "tessellate" a matrix into 4 smaller matrices by deleting rows and columns as follows:
r= rand(size(P));
r1 = r(1:2:end,1:2:end);
r2 = r(1:2:end,2:2:end);
r3 = r(2:2:end,1:2:end);
r4 = r(2:2:end,2:2:end);
But how do I reassemble the matrix to become r again?

Best Answer

r(1:2:end,1:2:end) = r1;
r(1:2:end,2:2:end) = r2;
...
Related Question