Error : {invalid} .* {convex}


(Aditya Srivastava) #1

I am getting this error when doing:
cvx_begin
variable X complex
minimize alpha1 * abs(X-c1)+alpha2 * abs(X-c2)
subject to
atan(imag(X)/real(X))= alpha1 * a1+alpha2 * a2
cvx_end
Where alpha1 and alpha2 are real nonnegative numbers
Error : {invalid} .* {convex}

Please guide me through this. Thanks in advance.


(Mark L. Stone) #2

imag(X)/real(X)) is not convex and is not allowed, nor is atan of any CVX variable or expression.


(Aditya Srivastava) #3

Thank you Mark. Actually the error is coming in the previous line which says “minimize…” . Please tell something about that as well.


(Mark L. Stone) #4

You haven’t provided a reproducible problem, complete with all inputs (alpha1, alpha2, c1, c2) . Therefore, I don’t know what went wrong on that line of code.

Edit: Based on the error message, perhaps alpha1 or alpha2 were somehow corrupted, for instance having value NaN , rather than being what you claim to be real nonnegative numbers.