can anyone help me how to rotate an image using for loop

5 ビュー (過去 30 日間)
vetri veeran
vetri veeran 2014 年 10 月 11 日
回答済み: Matt J 2014 年 10 月 12 日
Hi, I am new to this matlab language. This is the image and I need to rotate this image by 90 without using matlab functions.can anyone help me in this regard.
Thanks in advance
  4 件のコメント
vetri veeran
vetri veeran 2014 年 10 月 12 日
This is the image which i given below, and I need to rotate this image by 90 without using matlab functions such that the size should not cropped or changed. Finally, i need to display the rotated image.can you help me in this regard.
Thank you
Jan
Jan 2014 年 10 月 12 日
This is a homework question. So please show us, what you have tried so far and ask a specific question.

サインインしてコメントする。

採用された回答

Matt J
Matt J 2014 年 10 月 12 日
I can't see how you would do this without at least the size() command. You need that to determine the size of your loops.
Anyway, because this is homework, I will just give an example similar to what you are asking. Below is code to transpose a matrix purely with loops. I leave it to you to modify it as needed for a 90 degree rotation.
[m,n]=size(A);
for i=m:-1:n
for j=n:-1:1
B(j,i)=A(i,j);
end
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by