Plot many DIFFERENT images in a loop after some processing

Hello,
I am working with a Matlab code where I want to run a loop. In each loop, I will do some processing and then show an image based on the processed data. When I go to the next loop, I want the previously stored image to be closed and generate a new image based on the latest data.
A sum up from my code is this :
for ww= 0.4:0.2:2.6
**********************image processing code*********************************
t1=1-ww*(dark_channel1/A); % part that connect ww with the image processing code
**********************image processing code*********************************
out = pic;
figure;
imshow (out)
imwrite(out,sprintf('%d.jpg',ww));
End;
What I expect is many different images depend on the "ww", but the output that I take looks like in each iteration each image sticks to the previous one.
I think that somehow I can’t separate the output (image), and after each iteration I don't reset my loop. As a result I display a new image but stack on the previous. It is like in each iteration the new image sticks to the previous.
Any suggestions??
Thank you in advance

5 件のコメント

Mathieu NOE
Mathieu NOE 2021 年 3 月 18 日
keep always the same figure - so :
figure(1);
Tsitsos Dimitris
Tsitsos Dimitris 2021 年 3 月 18 日
Thank you for your answer.
But still can't solve my problem. After each iteration the output (photos) still look like it's stick to the previous photo.
The problem is that I don't know how to reset my loop. I want each photo to be different from the previous.
Thank you again
Rik
Rik 2021 年 3 月 18 日
Why did you repost your question? Now the discussion is split between this thread and your previous one.
Tsitsos Dimitris
Tsitsos Dimitris 2021 年 3 月 18 日
thw previous was wrong. I thought that i deleted it. I am sorry I am going to delete it now
Rik
Rik 2021 年 3 月 18 日
Don't delete it, you received an answer. You should fix the issue there, not just post a new question.

回答 (0 件)

この質問は閉じられています。

質問済み:

2021 年 3 月 18 日

閉鎖済み:

Rik
2021 年 3 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by