以下是加入输出不稳定点的代码:

A=[1 2 -1 2;2 6 3 0;4 7 -8 -5;7 2 1 6]; B=[-1;0;0;1]; C=[-2 5 6 1]; D=7; figure(1) rlocus(A,B,C,D); P=poly(A); r=roots(P); ii=find(real(r)>0); n=length(ii); if n>0 disp('系统不稳定'); disp('不稳定点为:'); disp(r(ii)); else disp('系统稳定'); end [p,z]=pzmap(A,B,C,D); zz=find(real(z)>0); n1=length(zz); if n>0 disp('不是最小相位系统'); else disp('是最小相位系统'); end figure(2) pzmap(A,B,C,D)