Hello,

I included the line below in my code to express a constraint in my CVX specification:

(1-tau)* log2(1 + h(k) * p(k) / ((1-tau)*sigma2)) >= R

When my code ran, the error " Cannot perform the operation: {real affine} ./ {real affine}" was returned.

So I looked up this website and used the suggestion made by @mcg to use the rel_entr function, I changed the constraint to

-rel_entr(tau,tau + 100,000*h(k)*p(k))>= R; (the 100000 there is because sigma2 = 0.00001)

Where R and tau are the unknowns in this expression. h(k) and p(k) are vectors whose values had been specified in the body of the MATLAB code.

The constraint error I got this time with the â€śrel_entrâ€ť function expression was â€śToo many input arguments.â€ť

Does anyone know a better way to formulate this expression in CVX for it to be accepted?

Thanks.