0

I have an image that I'd like to rotate by 90 degrees right, how can I do it without using any toolbox.

I've written a function that puts a picture on a sub-picture after user gives 4 points. I believe there has to be an easier way.

Thanks in advance!

enter image description here

Tony Tannous
  • 463
  • 1
  • 10
  • 23

1 Answers1

0

Knowing rot90 rotates the image to the left try this.

  1. Flip the image
  2. Rotate it left
  3. Flip it back.

The image will then be rotated right. Whether it is flipped left-right using fliplr or up-down using flipud does not matter.

-or-

Use rot90 3 times.

The following is a slight modification of the MATLAB example

load mandrill
figure('color','k')
image(fliplr(rot90(fliplr(X))))
colormap(map) 
axis off          % Remove axis ticks and numbers
axis image
Agriculturist
  • 521
  • 9
  • 20