Hello,
I'm using a semivar in my model.
inc = semivar(1, size(matrix, 1));
constraints = [ 0.2 <= inc <= max ];
Is there any possibility to restrict the total number of inc values unequal zero?
I tried
constraints = [constraints,...
0 <= sum((increase ~= 0)) <= 30];
and
0 <= sum((increase >= 0.1)) <= 30];
but it always shows the error: "Undefined function 'sum' for input arguments of type 'constraint'."
I don't wanna use implies and create a binary variable for every element of inc since there are like 7000 - 25000 elements of inc in my model.
Kind regards