can anyone help me how to rotate an image using for loop
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
vetri veeran
am 11 Okt. 2014
Beantwortet: Matt J
am 12 Okt. 2014
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145678/image.jpeg)
4 Kommentare
Jan
am 12 Okt. 2014
This is a homework question. So please show us, what you have tried so far and ask a specific question.
Akzeptierte Antwort
Matt J
am 12 Okt. 2014
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!