📄 fig27.m
字号:
% Generates Fig 2.7% Computer Controlled Systems (3rd ed)% Author: B. Wittenmark% Last edit: 1997-06-27% 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'))opt=simset('Outputpoints','specified');Ms=7;damp=0.5;om=1.83;clf;%h=0.125;omm=om*sqrt(1-damp*damp);alfa=exp(-damp*om*h);beta=cos(omm*h);gam=sin(omm*h);b1=1-alfa*(beta+damp*om*gam/omm);b2=alfa*alfa+alfa*(damp*om*gam/omm-beta);a1=-2*alfa*beta;a2=alfa*alfa;[t,x,y]=sim('block27',[0:h:7.5],opt);subplot(3,2,1)hpl=plot(t,y,'m.');axis([0,7.5,0,1.5]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 5],'ytick',[0 1]);set(hpl,'MarkerSize',Ms)%title('Fig 2.7','Fontname','NewCenturySchlbk');text(-1.5,1.4,'(a)','fontname','NewCenturySchlbk','fontsize',9)drawnow;%h=0.25;omm=om*sqrt(1-damp*damp);alfa=exp(-damp*om*h);beta=cos(omm*h);gam=sin(omm*h);b1=1-alfa*(beta+damp*om*gam/omm);b2=alfa*alfa+alfa*(damp*om*gam/omm-beta);a1=-2*alfa*beta;a2=alfa*alfa;[t,x,y]=sim('block27',[0:h:7.5],opt);subplot(3,2,2)hpl=plot(t,y,'m.');axis([0,7.5,0,1.5]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 5],'ytick',[0 1]);set(hpl,'MarkerSize',Ms)text(-1.5,1.4,'(b)','fontname','NewCenturySchlbk','fontsize',9)drawnow;%h=0.5;omm=om*sqrt(1-damp*damp);alfa=exp(-damp*om*h);beta=cos(omm*h);gam=sin(omm*h);b1=1-alfa*(beta+damp*om*gam/omm);b2=alfa*alfa+alfa*(damp*om*gam/omm-beta);a1=-2*alfa*beta;a2=alfa*alfa;[t,x,y]=sim('block27',[0:h:7.5],opt);subplot(3,2,3)hpl=plot(t,y,'m.');axis([0,7.5,0,1.5]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 5],'ytick',[0 1]);set(hpl,'MarkerSize',Ms)text(-1.5,1.4,'(c)','fontname','NewCenturySchlbk','fontsize',9)xlabel('Time','Fontsize',9,'Fontname','NewCenturySchlbk')drawnow;%h=1;omm=om*sqrt(1-damp*damp);alfa=exp(-damp*om*h);beta=cos(omm*h);gam=sin(omm*h);b1=1-alfa*(beta+damp*om*gam/omm);b2=alfa*alfa+alfa*(damp*om*gam/omm-beta);a1=-2*alfa*beta;a2=alfa*alfa;[t,x,y]=sim('block27',[0:h:7.5],opt);subplot(3,2,4)hpl=plot(t,y,'m.');axis([0,7.5,0,1.5]);set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'xtick',[0 5],'ytick',[0 1]);set(hpl,'Markersize',Ms)text(-1.5,1.4,'(d)','fontname','NewCenturySchlbk','fontsize',9)xlabel('Time','Fontsize',9,'Fontname','NewCenturySchlbk')drawnow;%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -