clear all; close all;
num = [ 1 ];
den = [ 1 2 1 ];
numc = [ 0.5 ];
denc = [ 1 0 ];
sys = tf( num, den );
c = tf( numc, denc );
sysL = c*sys;
figure(1)
nyquist(sysL)
xlim([-2,0])
ylim([-1 1])
figure(2)
w = logspace(-1, 1, 1000);
[gain1 phase1 w1] = bode(sysL, w);
gain1 = gain1(:);
gain1dB = 20*log10(gain1);
phase1 = phase1(:);
subplot(2,1,1)
semilogx(w1, gain1dB);
xlim([10^(-1),10^1])
ylim([-30 40])
xticks([10^(-1) 10^(0) 10^(1)])
yticks([-20 0 20 40])
grid;
xlabel('Frequency (rad/s)');
ylabel('Gain [dB]');
subplot(2,1,2)
semilogx(w1, phase1);
xlim([10^(-1),10^1])
ylim([-270 -90])
xticks([10^(-1) 10^(0) 10^(1) 10^(2) 10^(3)])
yticks([-270 -225 -180 -135 -90])
grid;
xlabel('Frequency (rad/s)');
ylabel('Phase [deg]');