Ok, for example, in the following code, no matter how many times I run it I obtained always the same matrix P and K, but if you run it, you will obtain other solutions but you will obtain the same ones no matter how many times you run the code, I want to obtain different P and K than those that I obtained always because the feasibility area contains more than just one P and K.
clc;clear;
Am1=[0 0;
0.0262 -0.2381];
Am2=[0 0;
0.0262 -0.3142];
Am3=[0 0;
-0.0262 -0.2381];
Am4=[0 0;
-0.0262 -0.3142];
Am={Am1,Am2,Am3,Am4};
A0=[-0.5 5;
0 -1];
C=[1 0;
0 0];
yalmip('clear');
Tolerance=0.001;
Order_of_system_n=size(C,2);
Number_of_row_of_C_n=size(C,1);
Number_Of_Sub_Systems=size(Am,2);
P=sdpvar(Order_of_system_n,Order_of_system_n);
K=sdpvar(Order_of_system_n,Number_of_row_of_C_n);
F=[];
F=[F,P >= Tolerance,K>= Tolerance];
for i=1:Number_Of_Sub_Systems
F=[F , A0'*P + P*A0 + Am{i}'*P + P*Am{i} - C'*(K)' - K*C <= -Tolerance ];
end
options = sdpsettings('solver','mosek');
sol = optimize(F,[],options)
if sol.problem == 0
P=value(P)
eig(P)
K=value(K);
L=inv(P)*K
display('Successfully solved');
else
display('Hmm, something went wrong!');
sol.info yalmiperror(sol.problem)
end