Reputation: 451
I have 13 figures named like figure(1), figure(2)... so on. I want to save all the figure at once in a specific folder D:\figures. I tried this.. What went wrong?
for i=1:1:13
saveas(figure(1),fullfile('D:\figures\',['figure' num2str(1) '.jpeg']));
end
Upvotes: 0
Views: 5320
Reputation: 9696
You're not using your loop-variable inside your loop...
Replace your 1
with i
:
for i=1:1:13
saveas(figure(i),fullfile('D:\figures\',['figure' num2str(i) '.jpeg']));
end
Upvotes: 1