global P_m M_m v a_t close all; % vykresleni figure % zalozi novy obrazek plot(t_v,v,'r',t_v,a_t,'b') % vykresleni prUbehU axis([0 T_sum 5/4*min(a_t) 5/4*max(v)]) title('Prubeh rychlosti a zrychleni stroje v case') xlabel('t [s]'), ylabel('v [km/h], a [m/s^2]') set(gca,'FontSize',20) grid on % vykresleni figure % zalozi novy obrazek plot(t_v,v,'r',t_v,M_m*0.1,'b') % vykresleni prUbehU axis([0 T_sum 5/4*min(M_pr)*0.01 5/4*max(v)]) title('Prubeh rychlosti stroje a krouticiho momentu na vystupu motoru v case') xlabel('t [s]'), ylabel('v [km/h], M_m*0.1 [Nm]') set(gca,'FontSize',20) grid on P_plus=[]; P_minus=[]; for i=1:length(t_v) if P_m(i)<0 P_minusi=P_m(i); P_plusi=0; else P_plusi=P_m(i); P_minusi=0; end P_plus=[P_plus;P_plusi]; P_minus=[P_minus;P_minusi]; end P_2m=[P_plus P_minus]; figure plot(t_v,P_2m) area(t_v,P_2m) title('Prubeh vykonu na vystupu motoru v case') xlabel('t [s]'), ylabel('P_m [kW]') set(gca,'FontSize',20) grid on