funklute
funklute

Reputation: 610

how to deal with big memory footprint of plots

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

Answers (1)

Luis Mendo
Luis Mendo

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

Related Questions