Hello !
My initial value is of size n and my objective function is :
objective=@(f) 0
Let us assume that :
m<=n.
I would like to impose that the solution f takes m non null values and the rest are 0.
I tried out the following non-linear constraint :
size(find(f~=0),1)-m
But I get the following message :
Converged to an infeasible point.fmincon stopped because the size of the current step is less thanthe default value of the step size tolerance but constraints are notsatisfied to within the default value of the constraint tolerance.<stopping criteria details>
Best Answer