My problem is like the below figure, I try to transform it to the convex problem. Thus, I take the “log” of both sides of the equation and use the bisection algorithm. After programing the Matlab code and run the code, the result is NaN. How do I debug it?

Matlab code
r=0.5;
l=1;
u=2;
t=(l+u)/2;
e=1e-8;
while(u-l>e)
cvx_begin
variables x(n)
minimize t
subject to
sum_square((x(n)))+log(t)+ipi<=0
norm(Ax-b,1)<=r
cvx_end
if strfind(cvx_status,‘Solved’)
u=t;
else
l=t;
end
end

I was trying to say I don’t believe what you have done is valid.

I don’t know what code you are running. if you don’t use the quiet option, the solver and CVX output should be displayed, which should explain why the results are NaN. But that presupposes CVX accepted your problem and did not produce an error message before calling the solver. A <= inequality with -log on the RHS will be rejected by CVX.

tr=0.5;
l=1;
u=2;
t=(l+u)/2;
e=1e-8;
while(u-l>e)
cvx_begin
variables x(n)
minimize t
subject to
sum_square((x(n)))+log(t)+i*pi<=0
norm(A*x-b,1)<=r
cvx_end
if strfind(cvx_status,‘Solved’)
u=t;
else
l=t;
end
end