% setup
clear all
close all
clc

% uncompensated dynamics
s=tf('s');          % Laplace variable
Go=2/(5*s+1);       % uncompensated open-loop  

figure(1)
margin(Go)

M=5;          % to decrease stationary error factor 5
wc=sqrt(3)/5; % from manual computation
a=0.1*wc;     % rule of thumb from lecture notes

Gk=M*(1+s/a)/(1+s*M/a); % compensation link

Gok=Go*Gk;     % compensated open loop
figure(2)
margin(Gok)

figure(3)
bode(Go,'b',Gok,'r')
legend('Go','Gk*Go')