w = logspace(1e-2,2,1000);

L = 100./(-w.^2+2*j*w+100);



mag = abs(L);

ang = phase(L);



% Bode plot

subplot(221);

semilogx(w,20*log10(mag));

xlabel('Frequency (rad/sec)');

ylabel('Magnitude (dB)');



subplot(222);

semilogx(w,180/pi*ang);

xlabel('Frequency (rad/sec)');

ylabel('Phase (deg)'); ylim([-190 10]);



subplot(223);

polar(ang,mag);

title('Polar plot');



subplot(224);

plot(180/pi*ang,log10(mag));

title('Gain/phase plot');

xlabel('Phase');

ylabel('Gain (log_{10}|L|)');