Is this problem convex? Or is there a way to make it convex?

Hi all,

I have the following problem here and I’m not sure I could make the constraint convex. If you can see any obvious way, then please shed some lights.

variable z(200,1)
znz = nonzeros(z);
minimize(obj)          %Obj is a linear objective function
subject to
sum(sign([0 znz].*[znz 0])) == length(znz)-1;

Your help would be greatly appreciated.

No, this is not convex, and cannot be made to be. What exactly are you trying to accomplish here? (Express it mathematically/in English, not with CVX code.) There’s a chance this may be mixed-integer representable but I don’t quite see what’s going on.

Thanks for your comment - I am trying to solve an optimization problem while constraining the solution to have one turning point, either one of the following shape \______/ or / . In the code, I am trying to constrain the sign of its derivative which obviously didn’t work.