Hi @Ho Pui Sum
That is the limitation of the place() command, and it is documentated here. In your case, the rank of the input matrix B is 2. Therefore, you are only allowed to place 2 repeated poles. See the workaround below.
A=[0 0 0 217.28; 0 0 127.33 0; 0 -1 -3.73 0.97; -1 0 0.97 -3.73]; %4*4
B=[0 0 -.38 -1.39; 0 0 -1.18 0.29].'; %4*2
rankB = rank(B) % number of repeated poles cannot be greater than this value
C=[1 0 0 0]; %1st row of C
D=zeros(1, 2);
sys = ss(A, B, C, D)
% Desired pole locations
% desired_poles = -1 * ones(1, size(A, rank(B))) % All poles at -1
desired_poles = [-1.0001, -1, -1, -0.9999]
% Calculate the feedback gain matrix K using pole placement
k = place(A, B, desired_poles)
% Create the closed-loop system
Aclosed = A - B * k;
Bclosed = B;
Cclosed = C;
Dclosed = D;
% Check the poles of the closed-loop system
closed_loop_poles = eig(Aclosed);
disp('Poles of the closed-loop system:');
disp(closed_loop_poles);
