% Problem 5.23 - Controllability of inverted pendulum

A=[0 1 0 0;
   0 0 -0.98 0;
   0 0 0 1;
   0 0 21.56 0]

B=[0; 1; 0; -2]

% Controllability matrix
Co=ctrb(A,B)
r_Co=rank(Co)
if r_Co < size(A,1)
  disp('Inverted pendulum is not controllable!')
else
  disp('Inverted pendulum is controllable!')
end


