我编写了一个脚本,用于在matlab中根据我的模拟结果生成图表。以下代码
print( gcf, '-dpng', [folder_name '/Diagramme/Fy-alpha.png']);
在脚本中写了16次,只是用另一个表达式来表示" Fy-alpha.png"而这只是最后一次出错。但其中有很多:
alternatePrintPath> printCleanup(第314行)
时出错alternatePrintPath> printSetup(第212行)中的错误
alternatePrintPath中的错误(第91行)
打印错误(第215行) pj = alternatePrintPath(pj);
GeneratePlots_v13(第611行)打印错误(gcf,' -dpng', [folder_name' /Diagramme/Fy-alpha.png']);
这些是matlab正在产生的错误,但是上面有大量的链接列表,例如" Java异常发生之后:"或"线程中的异常" AWT-EventQueue-0" java.lang.OutOfMemoryError:无法创建新的本机线程"。这种链接的一个例子是"在java.util.concurrent.ThreadPoolExecutor.ensurePrestart(未知来源)"
你们有什么想法,这里出了什么问题?
编辑:
% define plot properties
figure('Position', [100, 100, 1024, 768]);
% title('blablub');
Fy = reshape(erg_sl.Tire.F_iy_L_N.Data,4,[],1);
alpha_i = reshape(erg_sl.Tire.alpha_i_deg.Data,4,[],1);
% ----- Subplot 1 --------------------------------------------------------
% define plot properties
subplot(2,2,1)
hold on; grid on;
title('Rad1 (FL)');
xlabel('Schräglaufwinel alpha_i[deg]');
ylabel('Reifenquerkraft F_iy[N]');
% xlim([0 200]);
% ylim([200 400]);
% From Carmaker
if ex_cm==1
scatter(-erg_cm.Car_SlipAngleFL.data*180/pi,erg_cm.Car_FyFL.data,2,'b')
end
% From Simulink
scatter(alpha_i(1,:),Fy(1,:),2,'r')
% Legende
legend('Carmaker','Simulink','Location','SouthEast');
% ----- Subplot 2 --------------------------------------------------------
% define plot properties
subplot(2,2,2)
hold on; grid on;
title('Rad2 (FR)');
xlabel('Schräglaufwinel alpha_i[deg]');
ylabel('Reifenquerkraft F_iy[N]');
% xlim([0 200]);
% ylim([200 400]);
% From Carmaker
if ex_cm==1
scatter(-erg_cm.Car_SlipAngleFR.data*180/pi,erg_cm.Car_FyFR.data,2,'b')
end
% From Simulink
scatter(alpha_i(2,:),Fy(2,:),2,'r')
% Legende
legend('Carmaker','Simulink','Location','SouthEast');
% ----- Subplot 3 --------------------------------------------------------
% define plot properties
subplot(2,2,3)
hold on; grid on;
title('Rad3 (RL)');
xlabel('Schräglaufwinel alpha_i[deg]');
ylabel('Reifenquerkraft F_iy[N]');
% xlim([0 200]);
% ylim([200 400]);
% From Carmaker
if ex_cm==1
scatter(-erg_cm.Car_SlipAngleRL.data*180/pi,erg_cm.Car_FyRL.data,2,'b')
end
% From Simulink
scatter(alpha_i(3,:),Fy(3,:),2,'r')
% Legende
legend('Carmaker','Simulink','Location','SouthEast');
% ----- Subplot 4 --------------------------------------------------------
% define plot properties
subplot(2,2,4)
hold on; grid on;
title('Rad4 (RR)');
xlabel('Schräglaufwinel alpha_i[deg]');
ylabel('Reifenquerkraft F_iy[N]');
% xlim([0 200]);
% ylim([200 400]);
% From Carmaker
if ex_cm==1
scatter(-erg_cm.Car_SlipAngleRR.data*180/pi,erg_cm.Car_FyRR.data,2,'b')
end
% From Simulink
scatter(alpha_i(4,:),Fy(4,:),2,'r')
% Legende
legend('Carmaker','Simulink','Location','SouthEast');
% ------------------------------------------------------------------------
% Saving the figure
print( gcf, '-dpng', [folder_name '/Diagramme/Fy-alpha.png']);
编辑2:
% generate the variable "folder_name"
folder_name = uigetdir('/Users/username/Desktop/thesis/simulation/Results');
mkdir([folder_name '/Diagramme'])
% example of print-command that doesn't produce an error
print( gcf, '-dpng', [folder_name '/Diagramme/control.png']);