www.gusucode.com > signal 案例源码程序 matlab代码 > signal/ZerosPolesAndGainOfADiscreteTimeSystemExample.m

    %% Zeros, Poles, and Gain of a Discrete-Time System
% Consider a discrete-time system defined by the transfer function
%
% $$ H(z) = \frac{2+3z^{-1}}{1+0.4z^{-1}+z^{-2}}. $$
%%
% Determine its zeros, poles, and gain directly from the transfer function.
% Pad the numerator with zeros so it has the same length as the
% denominator.

% Copyright 2015 The MathWorks, Inc.

b = [2 3 0];
a = [1 0.4 1];
[z,p,k] = tf2zp(b,a)
%%
% Express the system in state-space form and determine the zeros, poles,
% and gain using |ss2zp|.
[A,B,C,D] = tf2ss(b,a);
[z,p,k] = ss2zp(A,B,C,D,1)