In my previous post, I'd mentioned processing 2-D matrices to put them into relevant rows and columns instead of just 5 numbers per line. This rearrangement of matrix elements uses the reshape function. In our case,
A_rz=reshape(A_rz',1,numel(A_rz));
A_rz=reshape(A_rz,30,30);
A_rz=A_rz';
A_rz=reshape(A_rz',1,numel(A_rz));
A_rz=reshape(A_rz,30,30);
A_rz=A_rz';