How do you solve the log2 problem

code is ‘nu_rc<=log2(real(trace(H_rc_het * U_r)+trace(H_rr_het * U_r)+trace(H_rt_het * U_r)) + No)-beta_rc_d;’
This is the line inside the constraint that gives an error.
The variable in this line is ‘nu_rc,U_r,beta_rc_d’, and the rest are constants.

The command line window will look like this:

Check that the call to function ‘log2’ does not have an incorrect argument data type or a missing argument.

Error Copy_of_F2_STARS_Optimization (line 80)

nu_rc<=log2(real(trace(H_rc_het * U_r)+trace(H_rr_het * U_r)+trace(H_rt_het * U_r)) + No)-beta_rc_d;

The size of the number in the log is about: log2(1.1357e-10)

log2 is not supported by CVX.

Enter log2(x) as log(x)/log(2)

The log2 problem has been solved successfully. Thank you for your help. Now there are new problems:




Part of the code is shown below, I think the derivation is OK, but running it gives an error.


Can I ask why this is not working and how to solve it, or any ideas to solve this problem?

Mosek warned about very large and near zero input data. You need to rescale the problem (change units) so that non-zero input data is within a small number of orders of magnitude of one. You should scale well enough to not get any Mosek warning messages. But you should try to scale even better than just enough to not get Mosek warnings.

In the future, please copy and paste text using the Preformatted text icon, rather than showing us an image.

You should also use the latest version of Mosek 10.x, rather than 9.1.9 which is bundled with CVX. In order to do so, follow the directions in

Thank you very much for your reply