📄 lqgclosed.m
字号:
% This is a scriptfile that simulates Fig 12:lqgclosed% Computer Controlled Systems (3rd ed)% Author: B. Wittenmark% Last edit: 1997-07-10% Copyright (c) 1996 by K. J. 舠tr鰉, B. Wittenmark and% Department of Automatic Control, Lund Institute of% Technology, Lund, Swedennewplot;clf;set(gcf,'PaperUnits','centimeters','PaperPosition',[2 2 13 10])set(gcf,'Units','centimeters','position',get(gcf,'PaperPosition'))lw=0.9;A=[1 -1.7 0.7];As=[0.7 -1.7 1];B=[0.9 1];Bs=[1 0.9];N=500;den=conv(A,As);num=[0 conv(B,Bs) 0];%rho=[0.000001:0.0001:0.1,0.1:0.01:1,1.1:0.1:10,logspace(1,4,N),1000000];[m,n]=size(rho);r=zeros(n,4);for i=1:n, tot=num+rho(i)*den; r(i,:)=roots(tot)'; end;ro4=sort(r');ro2=ro4(1:2,:)';plot(ro2,'k','Linew',lw);hold ont=0:.1:6.3;plot(sin(t),cos(t),'k-','Linew',lw)axis([-1.5,1.2,-1.1,1.1]);axis('equal');plot(-0.9,0,'mo');plot(0,0,'mo');plot(1,0,'mx');plot(0.7,0,'mx');set(gca,'Fontsize',9,'Fontname','NewCenturySchlbk');set(gca,'ytick',[-1 0 1]);set(gca,'xtick',[-1 0 1]);xlabel('Real axis','Fontsize',9,'Fontname','NewCenturySchlbk');ylabel('Imaginary axis','Fontsize',9,'Fontname','NewCenturySchlbk');plot([-3 3],[0 0],'k:','Linew',lw)plot([0 0],[-2 2],'k:','Linew',lw)rho=1;po(1,:)=roots(num+rho*den)';po4=sort(po');po2=po4(1:2,:)';plot(po2,'k*')text(0.08,0.43,'\rho =1','Fontsize',9,'Fontname','NewCenturySchlbk')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -