Save Image Files in a loop

조회 수: 5 (최근 30일)
Maria Jaramillo
Maria Jaramillo 2018년 6월 28일
답변: D. Plotnick 2018년 6월 28일
Hello,
I have a program that generates certain images and saves them at the end and I have to actually hit save at the end, I am trying to make a loop for the same program, that will override the value of the parameter and save each file every time. I tried a simple for loop but it only saves the file once. when it goes through the first value of the parameter.

채택된 답변

D. Plotnick
D. Plotnick 2018년 6월 28일
Something like this should work: just iterate over the save-name for the image.
for i = 1:I
image = doStuff(data);
imagesc(image);
fName = ['fileNameBase_',num2str(i),'.png'];
saveas(gca,fName);
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by