Can someone explain to me what this error exactly mean?

Error using sparse
Index exceeds array bounds.

Error in pretransfo (line 468)
dblks = cumsum(full(sparse(1,bstrt,1,1,sdpL)));

Error in sedumi (line 261)
[A,b,c,K,prep,origcoeff] = pretransfo(A,b,c,K,pars);

Error in cvx_run_solver (line 50)
[ varargout{1:nargout} ] = sfunc( inputs{:} );

Error in cvx_sedumi>solve (line 245)
[ xx, yy, info ] = cvx_run_solver( @sedumi, At, b, c, K, pars, ‘xx’, ‘yy’, ‘info’, settings, 5 );

Error in cvxprob/solve (line 435)
[ x, status, tprec, iters ] = shim.solve( At, b, c, cones, quiet, prec, solv.settings, eargs{:} );

Error in cvx_end (line 88)
solve( prob );

Error in Optimization_ome_SDPCCP (line 98)

Error in Main_Convergence (line 171)
[ome_opt,X_opt,SNR_BS] = Optimization_ome_SDPCCP(EdeltaS,r_max,Delta_theta,Delta_phi,lamda,theta_S,phi_S,HBR,h_RK1,h_RK2,h_RK3,h_BK1,h_BK2,h_BK3,sigma_BS,sigma_UE,Ptx,M,Nx,Ny,wc_in,ws_in,wrx_in,ome_in,d,accu,gamma);

First of all, make sure you are not using CVX 3.0beta, which is riddle with bugs which are very unlikely to ever be corrected. Make sure you are using CVX 2.2. If that doesn’t resolve the error, then please read further/

I’m guessing it is either a bug in SeDuMi or in thew CVX/SeDuMi interface. You can file a CVX bug report with reproducible CVX example per Support — CVX Users' Guide . But you shouldn’t have high expectations that anything will come of it.

Have you tried another solver, such as SDPT3 or Mosek, to see what happens? It is also possible that the error might go away if you use a new MATLAB session, in case the error is due to the MATLAB session being corrupted.

Thanks for your reply, am using cvx 2.2,
I had submitted a bug report by Email
I haven’t tried another solver yet, I will try and hopefully it works , if not i will feed you back

I have tried all of the above solutions, but none of them have worked.
in the first iteration the algorithm works perfectly and produced the expected results. However, in the second iteration I encountered the error message ‘Index exceeds array bounds,’ which I had provided earlier.
This is my cvx model:

Total_overall_iter = 10;
for overall_i = 1:Total_overall_iter
total_iter = 30;
for k = 2:Total_iter
X_k = X_opt;

Upsilion = 0;

 for ii = 1 : ((N+1)^2)
    Upsilion = Upsilion...
        + trace ((S(:,:,ii)+(S(:,:,ii))')*X_k)*(S(:,:,ii)+(S(:,:,ii))')-trace((S(:,:,ii)-(S(:,:,ii))')*X_k)*(S(:,:,ii)-(S(:,:,ii))');
 Upsilion_k = (1/4)* Upsilion ;
 Upsilion_k = roundn(Upsilion_k,6);

 % Solve problem
 cvx_begin quiet
 cvx_solver sedumi
 cvx_precision best
     variable X(N+1,N+1) hermitian;
     maximize ( trace((Upsilion_k)*X) )
     subject to
     for i = 1:(N+1)
            X(i,i) == 1;
     X == hermitian_semidefinite(N+1);
     trace ((X)*(Zc-gamma*Zs)) >=  gamma * (sigma_UE^2);


 X_opt = X;

 record_obj(k,1) = trace((Upsilion_k) * X);
 if abs(record_obj(k,1) - record_obj(k-1,1)) <= (0.002)


I doubt it will resolve your problem, but i recommend removing cvx_precision best. That is a well-intensioned capability which doesn’t seem to be a good idea for any solver.

I removed ‘‘cvx_precision best’’ , at the beginning it worked. Later, I changed some variables, and the same error popped up again.

You win some. You lose some.

anyhow thanks for your time and consideration.