% create state space system
A = [-1,-2;1,0];
B = [2;0];
C = [0,1];
D = 0;
sys = ss(A,B,C,D);
% Calculate the open-loop poles 
Pol  = pole(sys)
%check the step response of the open-loop system
figure(1)
step(sys)
hold on;
%  Use pole configuration to calculate the gain matrix K
p = [-1,-2];
K = place(A,B,p);
Acl = A-B*K;
syscl = ss(Acl,B,C,D);
Pcl = pole(syscl)
% check the closed-loop poles of syscl.
figure(1)
step(syscl)