📄 fig133.m
字号:
% Generates Fig 13.3 (identres)% Using the System Identification Toolbox% Computer Controlled Systems (3rd ed)% Author: B. Wittenmark% Last edit: 1997-08-04% Copyright (c) 1996 by K. J. 舠tr鰉, B. Wittenmark and% Department of Automatic Control, Lund Institute of% Technology, Lund, Swedennewplot;set(gcf,'PaperUnits','centimeters','PaperPosition',[2 2 13 10])set(gcf,'Units','centimeters','position',get(gcf,'PaperPosition'))lw=0.9;a1=-1.5;a2=0.7;b1=1;b2=0.5;c1=-1;c2=0.2;sig=0.5;model=poly2th([1 a1 a2],[0 b1 b2],[1 c1 c2]);u=idinput(600,'prbs',[0 1/6]);u=-u(1:500);randn('seed',0);e=sig*randn(500,1);y=idsim([u e],model);ustep=ones(100,1);ydet=idsim(ustep,model);tdet=[1:100];mydata=[y u];arx111=arx(mydata,[1 1 1]);y111=idsim(ustep,arx111);subplot(3,2,1)plot(tdet,y111,'k-',tdet,ydet,'k--','Linew',lw);axis([0,100,0 10]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 100],'ytick',[0 5 10]);ylabel('Output','Fontsize',9,'Fontname','NewCenturySchlbk')text(-28,10.3,'(a)','Fontsize',9,'Fontname','NewCenturySchlbk')arx221=arx(mydata,[2 2 1]);y221=idsim(ustep,arx221);subplot(3,2,2)plot(tdet,y221,'k-',tdet,ydet,'k--','Linew',lw);axis([0,100,0 10]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 100],'ytick',[0 5 10]);ylabel('Output','Fontsize',9,'Fontname','NewCenturySchlbk')text(-28,10.3,'(b)','Fontsize',9,'Fontname','NewCenturySchlbk')arx441=arx(mydata,[4 4 1]);y441=idsim(ustep,arx441);subplot(3,2,3)plot(tdet,y441,'k-',tdet,ydet,'k--','Linew',lw);axis([0,100,0 10]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 100],'ytick',[0 5 10]);ylabel('Output','Fontsize',9,'Fontname','NewCenturySchlbk')xlabel('Time','Fontsize',9,'Fontname','NewCenturySchlbk')text(-28,10.3,'(c)','Fontsize',9,'Fontname','NewCenturySchlbk')armx2221=armax(mydata,[2 2 2 1]);ym2221=idsim(ustep,armx2221);subplot(3,2,4)plot(tdet,ym2221,'k-',tdet,ydet,'k--','Linew',lw);axis([0,100,0 10]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 100],'ytick',[0 5 10]);ylabel('Output','Fontsize',9,'Fontname','NewCenturySchlbk')xlabel('Time','Fontsize',9,'Fontname','NewCenturySchlbk')text(-28,10.3,'(d)','Fontsize',9,'Fontname','NewCenturySchlbk')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -