MATLAB memory pileup in batch printing of figures

2019-07-16 19:00发布

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?

1条回答
倾城 Initia
2楼-- · 2019-07-16 19:46

This seems like a memory leak. You may be able to help Matlab release the leaked memory by closing each figure after printing. Create a new figure for each thing you want to print.

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

% item 2
f = figure;
% plot
% print
close(f)
查看更多
登录 后发表回答