Save image for each iteration

how do I save image for each iteration for any graphs to a certain file

 Accepted Answer

for k=1:3
% your code
FileName=sprintf('fig%d.jpg',k)
saveas(gcf,FileName)
end

1 Comment

k = 1:3 is the number of iteration? so if i have multiple iteration, i just hv to calculate the total iteration? where the file will be saved? tq

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Asked:

on 15 Jun 2014

Commented:

on 16 Jun 2014

Community Treasure Hunt

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

Start Hunting!