This post was edited from the original to state have <= the minimum value rather than have the minimum value.
I don’t understand your question. Do you want X(:,1) <= min(X(:,2:end),[],2).
For each row, that constrains the first element to have <= the minimum value in that row (but ties are allowed).
I try your code but the problem is still here. X(:,1) <= min(X(:,2:end),[],2)
Although the first column is smaller than the last columns, it becomes zero not the minimum value.
I try to set constraint as: X(:,1) = min(X(:,2:end),[],2)
I wish that the variable’s first column is the minimum value in the remaining columns.
But there is error as:
The following cvx variable(s) have been cleared or overwritten:
y
This is often an indication that an equality constraint was
written with one equals ‘=’ instead of two ‘==’. The model
must be rewritten before cvx can proceed.
Whoops, my constraint constrained the first column to be <= the minimum of the other columns. (I wrote it incorrectly, but have now fixed it).
To do what you want, you can’t use a constraint (==), because that is a non-convex equality constraint. You can’t do assignment (’=’) to a variable; that is why you got the error message. So what you do is declare X to have one fewer columns, and use a new variable X_min_per_row to be the minimum of the columns of the now reduced dimension X. Assume your original X was m by n.
Make adjustments in the rest of your program as needed in light of this. if you want to create the original X, you can do so by concatenation. X_original = [X_min_per_row X];
Because the expression X_min_per_row is not a scalar, it needs to be declared as an expression holder (array), as I have done, although expression X_min_per_row(m) could be used instead.
Thank you for your help.
When I add X_min_per_row to object function,it warns me that Illegal operation: {concave} + {convex}.
My Partial objective function is to minimize X_min_per_row。
Maybe there is a good way to Convert {concave} into {convex}?