display_pz.m

来自「离散控制系统设计的MATLAB 代码」· M 代码 · 共 42 行

M
42
字号
function  display_pz(S)%  displays poles & zeros as two column array%%  syntax:   display_pz(S)%%  input:  S  is any ss-system in packed form%  output: PZ is an N x 2 array, with poles in first column%		and zeros + NaNs as required in 2nd column%%%%%%%%%%%%%%%%% display_pz.m %%%%%%%%%%%%%%%%%%%   Discrete-Time Control Problems using        %%       MATLAB and the Control System Toolbox   %%   by J.H. Chow, D.K. Frederick, & N.W. Chbat  %%         Brooks/Cole Publishing Company        %%                September 2002                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%---- find poles and sort by real part, rightmost firstpp = eig(unpack_ss(S,'a'));[ppp,ii] = sort(real(pp));poles_S = pp(ii(length(ii):-1:1));%---- find zeros and sort by real part, rightmost firstzz = tzero(S);[zzz,ii] = sort(real(zz));zeros_S = zz(ii(length(ii):-1:1));pz = [poles_S  Inf*ones(length(pp),1)...		  [zeros_S;  NaN*ones(length(pp)-length(zz),1)]];disp(' ')disp('    Poles                                  Zeros')disp('----------------------------------------------------')disp(pz)if  poles_S(1) > 0,	disp(' ')	disp('**** RHP pole ==> unstable system ****')end%%%%%%%%%%

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?