%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)))));