# CVX causes "Index exceeds matrix dimensions." when sloving a SDP

When I use CVX to solve a AO(alternative optimization) problem with some W matrix,it will causes “Index exceeds matrix dimensions.”;
My code is

``````            cvx_begin sdp
variable tao1;
variable tao2;
variable S(3,3);
variable u;
minimize tao1-tao2
subject to
[u*Ite-kron(S',It)*kron(Ie,(W0+V0)),-(kron(S',It)*kron(Ie,(W0+V0)))'*g(:,:,m);
-g(:,:,m)'*kron(S',It)*kron(Ie,(W0+V0)),real(g(:,:,m)'*kron(S',It)*kron(Ie,  (W0+V0))*g(:,:,m)+tao1-real(trace(S*sigmaE))-u*delta+Ne)]>=0;%LMI,where W0 and V0 is (5*5) hermitian martrix each g is a vector of long 15
real(log_det(S))>=tao2;
u>=0;
S>=0;
tao1-tao2>=0;
cvx_end
``````

Here I omit definations of some martrix.
The error log is:

??? Index exceeds matrix dimensions.

Error in ==> cvxprob.eliminate at 179
P = P( :, colX ) + P( :, cols ) * temp;

Error in ==> cvxprob.solve at 18
[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true,
shim.dualize );

Error in ==> cvx_end at 88
solve( prob );

Error in ==> robust_AO at 72
cvx_end
In some W0 and V0,for example:`

``````W0=[0.208500600278235 + 0.00000000000000i,0.205507252153283 + 0.197502763873379i,0.158812499708879 + 0.00769805282885763i,-0.137044424693122 - 0.0975543228834839i,-0.0863977917828123 - 0.0430524375949142i;
0.205507252153283 - 0.197502763873379i,0.425191346650973 + 0.00000000000000i,0.170344314471800 - 0.154074976809452i,-0.267657565213141 + 0.0282967634514140i,-0.147648003694779 + 0.0433709327111782i;
0.158812499708879 - 0.00769805282885763i,0.170344314471800 + 0.154074976809452i,0.125991173142724 + 0.00000000000000i,-0.113660179500295 - 0.0829169624514590i,-0.0726313209591183 - 0.0357314877746509i;
-0.137044424693122 + 0.0975543228834839i,-0.267657565213141 - 0.0282967634514140i,-0.113660179500295 + 0.0829169624514590i,0.181926854268419 + 0.00000000000000i,0.100865149217794 - 0.0198831265842923i;
-0.0863977917828123 + 0.0430524375949142i,-0.147648003694779 - 0.0433709327111782i,-0.0726313209591183 + 0.0357314877746509i,0.100865149217794 + 0.0198831265842923i,0.0583901895370838 + 0.00000000000000i;];
V0= [-1.71009382210485e-08 + 0.00000000000000i,5.47413930908228e-09 + 4.32460106867411e-09i,5.47570339181388e-09 + 1.83112114401884e-10i,3.03967253050119e-10 - 6.41642756409934e-10i,-5.11845293947126e-11 - 7.81676687905688e-10i;
5.47413930908228e-09 - 4.32460106867411e-09i,-1.61618058935886e-08 + 0.00000000000000i,4.10578977689554e-09 - 2.03497246824934e-09i,-5.06987567872446e-09 - 8.47409338071635e-10i,-3.34567884264139e-09 - 1.00441398724954e-09i;
5.47570339181388e-09 - 1.83112114401884e-10i,4.10578977689554e-09 + 2.03497246824934e-09i,-2.26531653435558e-08 + 0.00000000000000i,-1.58733071763698e-09 + 4.34270534592534e-10i,-4.48278337238885e-10 - 1.39111962626349e-09i;
3.03967253050119e-10 + 6.41642756409934e-10i,-5.06987567872446e-09 + 8.47409338071635e-10i,-1.58733071763698e-09 - 4.34270534592534e-10i,-2.18459670353610e-08 + 0.00000000000000i,2.36333195946502e-09 + 1.52252259500757e-09i;
-5.11845293947126e-11 + 7.81676687905688e-10i,-3.34567884264139e-09 + 1.00441398724954e-09i,-4.48278337238885e-10 + 1.39111962626349e-09i,2.36333195946502e-09 - 1.52252259500757e-09i,-2.49237279703607e-08 + 0.00000000000000i;] ;
``````

W0 and V0 is generated by another SDP (as another part of AO algorithm),and thry are semidefinate and hermitian.
How can I slover this problem? Is this a CVX’s bug?

It is eye(5) and Ie is eye(3)

Error is solved. Add key word “semidefinite” behind S(3,3) and the error has gone.