% Written by: Daniel Llamocca (2013)
% Getting poles and zeros

clear all; close all; clc;
% X(s) = N(s)/D(s)
% (s^2 - 4)/ (2s^2 + 10s + 8)

% Create polynomial for N(s):
pN = [1 0 -4];

% Create polynomial for D(s):
pD = [2 10 8];

% Getting the zeros:
z = roots(pN);

% Getting the poles:
p = roots(pD);

% Plotting the pole-zero plot (needs the Control System toolbox)
pzmap(p,z);