- #1
mikeph
- 1,235
- 18
Hi,
I have a loop which produces a series of figures, specified by the iteration number.
For example the loop, simplified, is:
for i = 1:10
[code generating X and Y]
figure(i)
plot(X,Y)
end
So running it produces 10 images. I'd like to save them automatically, for future comparison.
How would I do this?
I've tried:
saveas(i,sprintf('%s.jpg',num2str(i)))
to save figure 1 as 1.jpg, and so on, but it's just giving me a blank white image.
Thanks for any help.
I have a loop which produces a series of figures, specified by the iteration number.
For example the loop, simplified, is:
for i = 1:10
[code generating X and Y]
figure(i)
plot(X,Y)
end
So running it produces 10 images. I'd like to save them automatically, for future comparison.
How would I do this?
I've tried:
saveas(i,sprintf('%s.jpg',num2str(i)))
to save figure 1 as 1.jpg, and so on, but it's just giving me a blank white image.
Thanks for any help.