I have a loop as such:
for n = 1:6
figure
plot()
saveas(gcf,'figure', 'jpeg')
end
This however just keeps saving the figures over each other since they all have the same name. What I need is to make it so the name is 'figure_n' where n is the iteration of the loop.