Implementing:(1-T)sum((log(1+(g.*E)/(1-T))))

%cvxtest.m
clear, close all
clc
g=[.9;.3;.4;.1;.6;.2;.8;.5];

cvx_begin
variable E(8);
variable T
maximize((1/log(2))*(1-T)*sum((log(1+(g.*E)/(1-T)))));
sum(E)-T==0;
0<T<1;
cvx_end

Error:

Error using .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {real affine} ./ {real affine}

Error in ./ (line 19)
z = times( x, y, ‘./’ );

Error in * (line 36)
z = feval( oper, x, y );

Error in / (line 15)
z = mtimes( x, y, ‘rdivide’ );

Error in cvxtest (line 9)
maximize((1/log(2))*(1-T)*sum((log(1+(g.*E)/(1-T)))));

Per How to implement this function using cvx?, you can express

a*log(1+p/a) as -rel_entr(a,a+p)

In your case, you can move (1-T) inside the sum and have that be your “a”, and g. * E be your “p”. No guarantee that I haven’t made a mistake though, but this should get you on the only path with promise.

Thanks for your useful response.