% Generates Fig 4.21 % Computer Controlled Systems (3rd ed) % Author: B. Wittenmark % Last edit: 1997-07-02 % Copyright (c) 1996 by K. J. Åström, B. Wittenmark and % Department of Automatic Control, Lund Institute of % Technology, Lund, Sweden close all; clear all; %block421; newplot; set(gcf,'PaperUnits','centimeters','PaperPosition',[2 2 13 10]) set(gcf,'Units','centimeters','position',get(gcf,'PaperPosition')) lw=2; h=0.5; sfbdesign l1=L(1); l2=L(2); l3=L(3); lc=l_c; obsdesign t0=0; clf; % [t,x,y]=sim('block421',[0, 80]); subplot(2,1,1); plot(t,y(:,3),'k--',t,y(:,1),'b','Linew',lw); axis([0,80,0,1.5]); %title(['Fig 4.21']); set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk'); set(gca,'xtick',[0 20 40 60 80]); set(gca,'ytick',[0 1]); ylabel('Output','Fontname','NewCenturySchlbk','Fontsize',9) title('u_c: a step at t = 0; v: a pulse of height: -10 & duration: 0.1 at t = 25') drawnow; % subplot(2,1,2); [ts,ys]=stairs(t,y(:,2)); plot(ts,ys,'r','Linew',lw); axis([0,80,-1,2]); set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk'); set(gca,'xtick',[0 20 40 60 80]); set(gca,'ytick',[-1 0 1 2]); xlabel('Time','Fontname','NewCenturySchlbk','Fontsize',9) ylabel('Input','Fontname','NewCenturySchlbk','Fontsize',9) title('Use etimated states as state feedback') drawnow; % ylblalgn;