I have a loop iterating on r and want to define the variable x^r in every iteration.
I know one possibility is defining an anonymous variable, but it is not what I need.
m=Model()
for r in 1:4
x = @variable(m, [r:r] )
end
I need the iteration number to be included in the variable name, so in the end of the iteration I’ll have: x^1 , x^2 , x^3 and x^4.