%Bode plot for non-minimum phase system
%kja 040602

aminit;

sys=tf(6*[-1 1],[1 5 6]);
sysmp=tf(6*[1 1],[1 5 6]);
w=logspace(-2,2);
[gain,phase]=bode(sys,w);gain=gain(:);phase=phase(:);
[gainmp,phasemp]=bode(sysmp,w);phasemp=phasemp(:);
subplot(3,2,1)
pl=loglog(w,gain,'b-');
set(gca,'Ytick',[0.01 0.1 1]);
set(pl,'Linewidth', AM_bode_linewidth);
axis([0.01 100 0.05 2]);
ylabel('g');
subplot(3,2,3)
pl=semilogx(w,phase,'b-',w,phasemp,'r--');
set(gca,'Ytick',[-270 -180 -90 0]);
set(pl,'Linewidth', AM_bode_linewidth);
axis([0.01 100 -270 20]);
xlabel('w');ylabel('p');

amprint('bodenmp.eps');
