2

I am printing a large number of figures to files. After a certain number, I get an out of memory error which a lot of other people have reported as well.

This question addresses the problem, but I cannot use the solution as I am printing various kinds of graphs including surface, plot, contour, quiver and scatter.

Is there a practical solution or a feasible workaround for this memory pileup problem that would allow to run the entire image printing in an unsupervised batch?

4

1 回答 1

3

这似乎是内存泄漏。您可以通过在打印后关闭每个图形来帮助 Matlab 释放泄漏的内存。为您要打印的每件东西创建一个新图形。

% item 1
f = figure;
% plot
% print
close(f)

% item 2
f = figure;
% plot
% print
close(f)
于 2013-09-06T15:41:04.480 回答