Reputation: 610
I'm doing some simulations that end up taking quite a bit of memory. The numbers themselves are ok for my machine though. But when I try to plot them, I run out of memory. I guess matlab's plots are a special format that makes use of all the data available. However, I'd like to skip that step, and just generate a .jpg or .png directly. I don't even need/want the plot to pop up on the screen, I'd rather just save it directly to file, and bring it up later when I want.
Is such a thing possible in matlab?
Upvotes: 1
Views: 75
Reputation: 112749
Try creating the figure as invisible:
figure('visible','off')
plot(x, y); %// Insert your plot commands here
print filename.png -dpng %// print figure to file
Upvotes: 1