Error when use logarit in CVX tool

Hello everybody!
I’m using CVX tool(installed on Matlab) to optimal y = log2(A*x-b) with A,b is 2 matrix.
My code follow:

 A = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16];    
 b = [1;2;3;4];  
 cvx_begin  
   variable x(4)   
   expression y  
      y = log2(A*x-b)  
   minimize (norm(y))  
   t = x   
 cvx_end

But, It has error: “Undefined function ‘log2’ for input arguments of type ‘cvx’.”. I don’t know how to use function ‘log2’ in CVX tool.
Please help me, thanks you !

1 Like

log2 is not supported in CVX, but log (natural logarithm) is. Use log(x)/log(2) in place of log2(x). In particular, use

y = log(A*x-b)/log(2)

in place of

y = log2(A*x-b)

Thanks Mark L.Stone very much!

Of course, you have a larger problem, and that is that your problem is not convex.

mcg, you caught me napping on that one.