% Program 6_1
% Determination of the Factored Form
% of a Rational z-Transform
% e.g. G(z) = (2Z4 + 16Z3 +44Z2 +56Z +32)/(3Z4 +3Z3 -15Z2 18Z -12)
%
%
%num = input('Type in the numerator coefficients = ');
%den = input('Type in the denominator coefficients = ');

num = [2 16 44 56 32];
den = [3 3 -15 18 -12];

K = num(1)/den(1);
Numfactors = factorize(num)
Denfactors = factorize(den)
disp('Numerator factors');disp(Numfactors);
disp('Denominator factors');disp(Denfactors);
disp('Gain constant');disp(K);
zplane(num,den)