Rotating an image matrix around its center in MATLAB
问题 Assume I have a 2x2 matrix filled with values which will represent a plane. Now I want to rotate the plane around itself in a 3-D way, in the "z-Direction". For a better understanding, see the following image: I wondered if this is possible by a simple affine matrix, thus I created the following simple script: %Create a random value matrix A = rand*ones(200,200); %Make a box in the image A(50:200-50,50:200-50) = 1; Now I can apply transformations in the 2-D room simply by a rotation matrix