Formulate constraint as conditional sum

Dear all,

I am using CVXR (i.e. the R package to solve CVX problems). In particular, I am trying to translate a constrained optimisation problem that I have successfully formulated and solved with the Excel Solver.

In particular, my problem reads as:

min sum(x)

k(y) > 0.9

x = Int(5) [integer variable with 5 observations]
y(x) = x/3
k(y) = sum(values of values of y that are <3)/100

How do I formulate it in CVX (CVXR)?


This forum addresses CVX, which runs under MATLAB. It does not address CVXR, which is a different package than CVX, and which runs under R.

In either case, i recommend you read the documentation, which for CVX is at To handle the conditional nature of the argument of sum in k(y), you can do Big M modeling along the lines of .