I doesn’t work for me because [k*34:min(k*34, min(k*34+34, K_window))] is a vector containing one range so the for loop has one iteration with l = k*34:min(k*34, min(k*34+34, K_window)) and the sum is therefore the some of one term which is the term itself and you are left with a vector that cannot be compared to 1.
So either do
sum(y_i_k[i, l] for l in k*34:min(k*34, min(k*34+34, K_window)))
or
sum(y_i_k[i, k*34:min(k*34, min(k*34+34, K_window))])
1 Like