Hi all,

I am new to CVX. I tried optimizing the shannon rate equation using CVX but i got the folowing error:

" Error in maximize (line 14)

x = evalin( ‘caller’, sprintf( '%s ', varargin{:} ) );

Error in try (line 44)

maximize sum((sum((v.*BB./Rmax{S}).^Umuus{S}(1:U,1:S))).^rho{S}) ". Below are my codes please could someone help/assist?

B = zeros(M,S,U);

for m =1:M

for s=1:S

for u=1:U

x = -q + 2*q*rand();

y = -q + 2*q*rand();

du = sqrt(x^2 + y^2);

Ld= 40*(1 -4*(10^-3)*h). log10(du./1000) - 18log10(h) + 21*log10(f) + 80;

PLdb = Ld + log10(X);

GBSi =10.^-(PLdb/10);

NoB= -174 + 10*log10(RB);

```
NB= (10.^(NoB/10))/1000;
BB(m,s,u) = RB*log2(1 + (PBSc*GBSi)/(NB))
end
end
```

end

cvx_begin

cvx_precision(‘best’)

variable v

maximize sum((sum((v.*BB./Rmax{S}).^Umuus{S}(1:U,1:S))).^rho{S})

subject to

sum(sum(v.*RB))<=B;

sum(sum(v))==1;

sum(v)>=0;

sum(v)<=1;

cvx_end

primal_obj=cvx_optval;