I would be very grateful if you could answer this question. In the absence of C8 constraints, CVX can run successfully without error. After adding the C8 constraint, no error is reported before the breakpoint debugging reaches “cvx_end”, but an error is reported after running to “cvx_end”. Here is my code: (I don’t know how to express space, “_” means space.)
cvx_begin quiet
variable omega;
variable q(2,1);
variable a(n,n);
variable z(1,n);
variable kappa(n,n);
variable miu(1,n);
variable phi(n,n);
variable rho(1,n);
variable xita(1,n);
expression A(1,n);
expression B(n,n);
expression C(n,n);
for i=1:n
__A(i) = pow_pos(H^2 + pow_pos((norm(q-wI(:,i))),2) - xita(i) + tao * chi(i),2);
end
for i=1:n
__for j=1:n
____ if i~=j
______B(i,j) = log(r(i) * dBE(j) * xita(j) + t(i) * r(j) * dBE(i) * xita(i)); %B(i,j)
____else
______B(i,j) = 0;
____end
__end
end
for i=1:n
__for j=1:n
____if i~=j
_____C(i,j) = -log(r(i) * dBE(j) * xita0(j))-(xita(j)-xita0(j))/xita0(j); %C(i,j)
____else
_____C(i,j) = 0;
____end
__end
end
maximize omega - lamda * sum(sum(phi)) - 1/(2 * tao) * sum(A)
subject to
__kappa >= 0;
__for i=1:n
____xita(i) <= M*(1-r(i)) * Pu * beta/Pc; %C1
____a(i,i) == 0; %C5
____(sigma * t(i) * xita(i)/(Pu * r(i) * beta^2 * dBE(i)^(-1))) + sum(B(i,:)) + sum(C(i,:)) >= log(1/p); %C8
____log(1+exp(z0(i)-rho0(i)))/log(2) + exp(z0(i)-rho0(i)) * (z(i)-z0(i)-rho(i)+rho0(i))/((1+exp(z0(i)-rho0(i))) * log(2)) >= omega + log(1+t(i))/log(2); %C9
____pow_pos(xita(i),2)/(gamma * r(i)) <= exp(-z0(i)) * (1-z(i)+z0(i)); %C10
____miu(i) <= xita0(i)^2 + 2 * xita0(i) * (xita(i)-xita0(i)); %C11
____1 + (sum(kappa(i,:)) - kappa(i,i)) <= exp(rho0(i)) * (rho(i)-rho0(i)+1); %C13
__end
__for i=1:n
____for j=1:n
______0 <= a(i,j) <= 1; %C2
______a0(i,j)^2 + 2 * a0(i,j) * (a(i,j)-a0(i,j)) + phi(i,j) >= a(i,j); %C3
______phi(i,j) >= 0; %C4
______if i~=j
_______a(i,j) + a(j,i) == 1; %C6
_______pow_pos(a(i,j)+xita(i),2)/4 + (pow_pos(a0(i,j)-xita0(i),2)-2 * (a0(i,j)-xita0(i)) * (a(i,j)-xita(i)))/4 <= xita(j); %C7
_______gamma * pow_pos(a(i,j)+r(j),2) + pow_pos(kappa(i,j)-miu(j),2) <= 2 * (kappa0(i,j)+miu0(j)) * (kappa(i,j)+miu(j)) - (kappa0(i,j)+miu0(j))^2 + gamma * (2*(a0(i,j)-r(j))*(a(i,j)-r(j))-(a0(i,j)-r(j))^2); %C12
______end
____end
__end
cvx_end

And the error is:
wrong usage *
The inner matrix dimensions must be consistent.

Error cvxprob/eliminate (line 137)
P = P * cvx_invert_structure( xR );

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

Error cvx_end (line 88)
solve( prob );

Error diedai (line 211) %diedai is script name
cvx_end
The C8 is:

(sigma * t(i) * xita(i)/(Pu * r(i) * beta^2 * dBE(i)^(-1))) + sum(B(i,:)) + sum(C(i,:)) >= log(1/p); %C8

I think this kind of error indicates either a bug in CVX or a “messed up” CVX installation. Make sure you are using CVX 2.2. Do not use CVX 3.0beta; If you are using CVX 3.0beta, remove all CVX items from MATLAB path, start a new MATLAB session, and install CVX 2.2

Things to try::

New MATLAB session

Different solver

Reinstall CVX 2.2

Reboot computer

If after doing all of these the error still occurs, file a bug report per http://cvxr.com/cvx/doc/support.html#bug-reports .

Thanks, I will try it.

I checked that the cvx version is 2.2. This error occurs when using both mosek and sdpt3.

Please follow the remaining directions in my post, including, if necessary, filing a bug report per the instructions.

Thanks for your answer. I tried again and found that as long as logarithm is added to the constraints, such as “log(xita(i)) >= 0”, this error will be reported, while “xita(i) >= 0” will not report an error. This looks like taking the logarithm of the variable will throw this error.

`-rel_entr(1,x) = log(x)` Does reformulating using `rel_entr` help? I don’t know.

Thank you so much, there is no error reported this time.