Sat 01 Apr 2017 12:02:36 PM UTC, original submission:
% Iterating "saveas" or "print" function crashes after many iterations (e.g. 500):
% given the following set up where we have an array of vectors we wish to plot, loading vectors in loop, performing plotting, labelling and saving works successfully up to a limit. Above this limit, the octave engine crashes. In the GUI I reach a limit of 505 plots, in the CLI I reach the limit of 509 plots.
for i = dataIndex = 1:N %(e.g. N = 1000)
v1 = csvread(strcat(PATHTOFILE,v1Data(dataIndex ).name));
v2 = csvread(strcat(PATHTOFILE,v2Data(dataIndex ).name));
% assuming length(v1) == length(v2) - my measurements were length(v1) == length(v2) == circa 40 to 50
h = figure;
plot(v1,v2,'-ob');
title(num2str(dataIndex));
u = max(max(v1,v2));
xlim([0 u]);
ylim([0 u]);
xlabel('v1');
ylabel('v2');
drawnow;
% following assumes filenames are preallocated in filenameout:
saveas(h,strcat(SAVEDIR,filenameout(dataIndex).name,'.png'),'png');
% OR:
%print(h,strcat(SAVEDIR,filenameout(dataIndex).name,'.png'),'-dpng');
close(h)
end
The Windows system resources are very far from saturation. Can anyone else replicate this condition or similar?
|