for j = 1:size(CN_Nb,1)
st = [st, sum(1 - v(j,2:(G(j)+1))) == 0];
end
for j = 1:size(CN_Nb,1)
for k = (1+G(j)):(NbTime-cn.UT(j)+1)
t = k+1;
st = [st, sum(v(j,t:t+cn.UT(j)-1)) >= cn.UT(j) * (v(j,t) - v(j,t-1))];
end
end
In this formula, G (j) is the parameter to be changed in each cycle, not the variable,But the optimizer will think it's a variable and can't recognize it.
error like this:
Undefined operator ':' for input arguments of type 'sdpvar'.
Error in year_optimazer (line 313)
st = [st, sum(1 - v(j,2:(G(j)+1))) == 0];
Do you have any way to solve this problem?