Let p_{i,j} \in \mathbb{R}_{\geq 0}, for i=1,\dots, n, j=1, \dots, m. As one of the constraints of my problem, I am looking for h such that

To find h, I defined a_{i,j} \in \{0,1\} such that

To implement the if condition above, I used the big-M method as

The problem is that the big-M method works well for ILPs while the variable, here the $p$s, are non-integer. When g_i(h) is very close to 1, I do not get the correct value for h.

I tried it out with different precision levels of CVX but it did not help either.

I was wondering if there is a trick for this in CVX.