clc
A=[2.8982 -3.1606 0.6816;6.3595 -4.2055 4.5423;3.2046 -3.1761 -3.8142]
B1=[2.0310 1.2164;0.4084 0.2794;-0.7775 -0.3307]
B2=[-0.0785;-0.0853;-0.0986]
C1=[-0.8778 -4.9442 -4.5084;4.0161 -2.0259 1.9318]
C2=[0.9607 1.5600 2.8558;-2.4371 1.3634 0.0095]
D1=[0.6004 0.2107;1.9320 -0.3997]
D2=[0.0330;-0.0414]
gama=sdpvar(1,1);
P=sdpvar(3,3);
W=sdpvar(3,2,'full');
object=gama;
M1=[A'*P+C1'*W'+P*A+W*C1 P*B2+W*D2 C2';(P*B2+W*D2)' -gama*eye(1) zeros(1,2);C2 zeros(2,1) -gama*eye(2)]
F=[M1<=0, P>=0];
options=sdpsettings('solver','mosek')
optimize(F,object,options)
gama=value(gama)
P0=value(P)
W0=value(W)
M1=value(M1)
L=inv(P0)*W0
