%  Plot the controller frequency responses.
set(0,'DefaultAxesFontName','times')
set(0,'DefaultAxesFontSize',16)
set(0,'DefaultTextFontName','times')
figure(2)
clf
subplot(211),
semilogx(w,20*log10(magc),'r-',w,20*log10(magcr5),'r--',w,20*log10(magc3),'r-.',w,20*log10(magc4),'r:')
grid
xlabel('Frequency (rad/sec)')
ylabel('Gain (dB)')
legend('Full','p-z5','bal3','bal4')
subplot(212),semilogx(w,phac,'r-',w,phacr5,'r--',w,phac3,'r-.',w,phac4,'r:')
grid
xlabel('Frequency (rad/sec)')
ylabel('Phase (deg)')
%
%  Plot the closed loop frequency responses.
figure(3)
clf
subplot(211),
semilogx(w,20*log10(mag),'r-',w,20*log10(magr5),'r--',w,20*log10(mag3),'r-.',w,20*log10(mag4),'r:')
grid
xlabel('Frequency (rad/sec)')
ylabel('Gain (dB)')
subplot(212),semilogx(w,pha,'r-',w,phar5,'r--',w,pha3,'r-.',w,pha4,'r:')
grid
xlabel('Frequency (rad/sec)')
ylabel('Phase (deg)')
legend('Full','p-z5','bal3','bal4')