MATLAB: How can i rotate an N-dimensional matrix

axismatrixrotate

hi all i am having trouble with project and need to figure out how i can rotate an N-dimensional matrix so that i can 'look in from the side'. ie rotate the matrix around a virtical axis. see attached image for discription.

Best Answer

A = cat(3,[1 2 3;4 5 6;7 8 9],[10 11 12;13 14 15;16 17 18])
out = permute(A,[3,1,2]);
Please read about function permute.