%% Zeros, Poles, and Gain of Continuous-Time System
% Generate a system with the following transfer function.
%
% H(s)=\frac{2s^2+3s}{s^2+\frac{1}{\sqrt{2}}s+\frac{1}{4}}=
%      \frac{2\,(s-0)\,(s-(-\frac{3}{2}))}
%      {(s-\frac{-1}{2\sqrt{2}}(1-j))\,(s-\frac{-1}{2\sqrt{2}}(1+j))}
% Find the zeros, poles, and gain of the system. Use eqtflength to ensure the numerator and denominator have the same length.

b = [2 3];
a = [1 1/sqrt(2) 1/4];

[b,a] = eqtflength(b,a);
[z,p,k] = tf2zp(b,a)

% Plot the poles and zeros to verify that they are in the expected locations.

fvtool(b,a,'polezero')
text(real(z)+.1,imag(z),'Zero')
text(real(p)+.1,imag(p),'Pole')

% Copyright 2015 The MathWorks, Inc.