I need to create a code in MATLAB that using imrotate function to rotate an image multiple times in increments of 60 degrees from 0 degrees to 300.

4 views (last 30 days)
This is what I have so far- my image is RB1 that I need to rotate
for i=0:300:60
C=imrotate(RB1,180,'crop');
imshow(C);
end
  2 Comments
Matt J
Matt J on 2 Sep 2021
Edited: Matt J on 2 Sep 2021
Valerie Yunis' original question
I need to create a code in MATLAB that using imrotate function to rotate an image multiple times in increments of 60 degrees from 0 degrees to 300.
for i=0:300:60
C=imrotate(RB1,i,'crop');
imshow(C);
end

Sign in to comment.

Answers (2)

Matt J
Matt J on 2 Sep 2021
Edited: Matt J on 2 Sep 2021
for i=0:60:300
C=imrotate(RB1,i,'crop');
imshow(C);
shg; pause(1);
end

Image Analyst
Image Analyst on 2 Sep 2021
Try adjusting your values for i and using drawnow;
for i=0: 60 : 300
C=imrotate(RB1,i,'crop');
imshow(C);
drawnow; % Force immediate screen refresh
% pause(0.5); % Optional pause
end

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!