% Define Constraints
Y1 = blkdiag(inv(10^-4),sdpvar(2));
M1 = [(Y1*(A11'))+(Y1*(A11'))'+(B1*G1)'+(B1*G1) Y1;
Y1' -gama1*eye(3)]
M2 = [-beta1*eye(3,3) G1';
G1 -eye(1,1)]
M3 = [Y1 eye(3);
eye(3) delta1*eye(3)]
% comment const1 = [Y1>=0,trace(Y1) == 1,M1<=0 ,M2<=0,trace(M2) == 1,M3>=0,trace(M3) == 1,gama1>=0,trace(gama1) == 1,beta1>=0,trace(beta1) ==
% comment 1,delta1>=0,trace(delta1) == 1]% there is a problem in M1Y constrain
const1 = [ Y1>=0 , M1<=0 , M2<=0 , M3>=0,gama1>=0,beta1>=0,delta1>=0]% there is a problem in M1 constrain
% Objective Function Definition
Obj = alpha11*gama1 + alpha21*beta1 + alpha31*delta1;
% Optimization
ops = sdpsettings('solver','sedumi','verbose',0);
Sol = optimize(const1,Obj,ops)
Info.Objective = value(Obj);
if Sol.problem == 0
Info.Solution = 'Successfully solved';
elseif Sol.problem == 4
Info.Solution = 'Numerical problems';
elseif Sol.problem == 1
Info.Solution = 'Infeasible';
elseif Sol.problem == -4
Info.Solution = 'Solver not applicable';
end
Info.Nu_LMI_variables = length(depends(const1)); % Number of LMI variables
Info.LMI_Constraints = length(const1); % Number of LMI constraints
% Finding Controller Gains
Info.G1 = value(G1);
Info.Y1 = value(Y1);
Info.P1 = inv(Info.Y1);
Info.K1 = value(G1) * inv(Info.Y1);
Info.L1 = eig(A11+B1*Info.K1);
Info