hi i have a problem in running the loop for my code given below
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
the problem is it is taking s value only as p i.e 512 i wanted to run for the range s=1 to 512, so as to get q as 512 values each for which of s value . I(:,:,1) r channel for lena image
ya=((1+(I(:,:,1).^2)));
p=512;
for s=1:p
Ya=ya.^(s);
k= fft2(allpixel);
f=abs(fft2(allpixel)).^2;
q=Ya.*f;
imshow(q,[])
total=(1/2*pi).*sum(sum(q));
end
7 Kommentare
KALYAN ACHARJYA
am 25 Jul. 2018
Bearbeitet: KALYAN ACHARJYA
am 25 Jul. 2018
what is ya? I is gray Image? What about allpixel? Clarify, so that I can check it.
juveria fatima
am 25 Jul. 2018
KALYAN ACHARJYA
am 25 Jul. 2018
Bearbeitet: KALYAN ACHARJYA
am 25 Jul. 2018
OK, how you find the "allpixels"? Better share complete code
Everything in your for loop is set to be overwritten each time through so yes, you will, at the end, be left with only the final result and plot, having thrown away all previous results and plots.
You need to use an array with indexing to store results, e.g.
q(s) = ...
having first presized q before the loop.
I don't know what you expect to happen with your imshow in the loop though. I assume you would want this outside the loop.
juveria fatima
am 25 Jul. 2018
juveria fatima
am 25 Jul. 2018
Stephen23
am 25 Jul. 2018
Antworten (0)
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!