www.pudn.com > controlsystem.ZIP > EX3042.M
% Example 3.42
%
% Design of state observer
%
g=[0 0 1; 1 0 0; -0.2 -0.5 1.1];
h=[0; 0; 1]; c=[1 0 0];
% Check the controllability and observability
disp('The rank of controllability matrix')
rc=rank(ctrb(g,h))
disp('The rank of observability matrix')
ro=rank(obsv(g,c))
% Design Digital controller
p=[0 0 0];
k=acker(g,h,p)
% Design state observer
gaa=g(1,1); gab=g(1,2:3);
gba=g(2:3,1); gbb=g(2:3,2:3);
ha=h(1,1); hb=h(2:3,1);
% Dual system
g1=gbb'; h1=gab';
p=[0 0];
k=acker(g1,h1,p);
ke=k'