Rotate n x m matrix

16 次查看(过去 30 天)
Yoeri
Yoeri 2014-11-4
评论: Makrim 2015-5-16
I have a two vectors X and Y, lengths 768 and 556. Furthermore, I have a matrix D of 768x556 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?

采纳的回答

Matt J
Matt J 2014-11-4
编辑:Matt J 2014-11-4
If you have the Image Processing Toolbox,
imrotate(D,10)
  2 个评论
Yoeri
Yoeri 2014-11-4
Perfect! Especially using imrotate(D,10,'crop').
Thanks a million.
Makrim
Makrim 2015-5-16
this will rotate arround the center of the matrix D !

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by