clear all; close all;
num = [ 0 0 1 ];
den = [ 1 0.3 1 ];
sys = tf( num, den );
w = logspace(-2, 1, 1000);
[ gain phase w ] = bode( sys, w );
gain = gain(:);
gaindB = 20*log10(gain);
phase = phase(:);
subplot(2,1,1)
semilogx(w, gaindB);
xlim([10^(-2),10^1])
ylim([-40 20])
yticks([-40 -30 -20 -10 0 10 20])
grid;
xlabel('Frequency [rad/s]');
ylabel('Gain [dB]');
subplot(2,1,2)
semilogx(w, phase);
xlim([10^(-2),10^1])
ylim([-180 0])
yticks([-180 -135 -90 -45 0])
grid;
xlabel('Frequency [rad/s]');
ylabel('Phase [deg]');