MATLAB: Rotate n x m matrix

coordinatenxm matrixrotate

I have a two vectors X and Y, lengths 768 and 556. Furthermore, I have a matrix D of 768×556 points, which is the actual data. The data is a measurement of the height of an area.
I would like to rotate the data-matrix D along the Z-axis of the XY-plot, about 10 degrees.
Up to now I have tried to do this by reshaping the matrix to an array and ajusting X and Y accordingly to get the correct lengths. Then I used a 3D rotation matrix around Z, but this does not really rotate the data, it only changes the dimensions of the axis.
Does anybody have a suggestion?

Best Answer

If you have the Image Processing Toolbox,
imrotate(D,10)