First I read the paper “Why isn’t CVX accepting my model? READ THIS FIRST!”

So I first transform the nonconvex problem into a convex optimization problem.

```
cvx_begin
H=rand(4,4);Nt=4;Pmax=100;BL=1;
variable p(Nt) nonnegative;
variable ganma(Nt) nonnegative;
variable beta1 nonnegative;
variable omiga(Nt) nonnegative;
variable cita(Nt);
expression R(Nt);
for i=1:Nt
expressions KK(i) WW;
for j=1:i
KK(j)=p(j)*(norm(H(:,i)).^2);
end
% WW=sum(KK)+1;
R(i)=2*cita(i)*sqrt((norm(H(:,i)).^2)*p(i)*(1+ganma(i)))-cita(i).^2*log(2)*(sum(KK)+1)+(log(1+ganma(i))/log(2)-ganma(i)/log(2));%-beta1*(sum(p)-Pmax)-omiga(i)*(BL^2-p(i));
end
maximize(sum(R));
subject to
beta1 >= 0;
% for ii=1:Nt
ganma >= 0;
omiga >= 0;
% end
cvx_end
```

**Error:**

错误使用 .* (line 262)

Disciplined convex programming error:

Invalid quadratic form(s): not a square.

出错 * (line 36)

z = feval( oper, x, y );

出错 text123 (line 39)

R(i)=2*cita(i) sqrt((norm(H(:,i)).^2)p(i)(1+ganma(i)))-cita(i).^2log(2)*(sum(KK)+1)+(log(1+ganma(i))/log(2)-ganma(i)/log(2));%-beta1*(sum§-Pmax)-omiga(i)*(BL^2-p(i));