%在一张图的基础上画局部放大图(仿真和混合模型的输出对比)
h=axes('Position',[0.1,0.1,0.8,0.8]);
h1=plot(Usim,'b');
hold on
h2=plot(Ut,'r');
axes('Position',[0.2,0.2,0.4,0.4]);
plot(1000:1500,Usim(1000:1500),'b');
hold on
plot(1000:1500,Ut(1000:1500),'r');
hleg1= legend(h, [h1 h2], 'Simulation Output', 'Hybrid Model Output', 0); %为两条曲线创建图例
set(hleg1,'Box','off','position',[0.6,0.75,0.2,0.1]);
set(get(h,'Xlabel'),'String','Time(s)','FontName','Times New Roman','FontSize',10,...
'FontWeight','bold','FontAngle','normal');%设置坐标轴刻度字体名称,大小
set(get(h,'Ylabel'),'String','Voltage(V)','FontName','Times New Roman','FontSize',10,...
'FontWeight','bold','FontAngle','normal');%设置坐标轴刻度字体名称,大小
set(h,'Xticklabel',{'0','5000','10000','15000','20000','25000','30000'}); %设置刻度的显示内容