%Section 8.6.1, p. 465
%Butterworth filter design
close all
n=5; %order of the filter to be designed
[z,p,k]=buttap(n);
%BUTTAP Butterworth analog lowpass filter prototype.
% [Z,P,K] = BUTTAP(N) returns the zeros, poles, and gain
% for an N-th order normalized prototype Butterworth analog
% lowpass filter. The resulting filter has N poles around
% the unit circle in the left half plane, and no zeros.

[num,den]=zp2tf(z,p,k);
%Converts to numerator and denominator poynomials
%Vectors NUM and DEN are
% returned with numerator and denominator coefficients in descending
% powers of s.

h=tf(num,den); %forms a transfer function object

h %display the TF

bode(h); %display the Bode plot

figure
zplane(num,den); %pole-zero plot (no zeros for BW)