For all with an if statement

Problems with syntax of GAMS
Post Reply
ZenSchmitt
User
User
Posts: 3
Joined: 2 years ago

For all with an if statement

Post by ZenSchmitt »

Im looking to do

for all i,

if(x(i) = 1, statement;);

How do I implement this?

Right now, I'm getting the 'Uncontrolled set entered as constant'
Fred
Posts: 372
Joined: 7 years ago

Re: For all with an if statement

Post by Fred »

Hi,

Try

Code: Select all

loop(i$(x(i)=1), statement;);
I hope this helps!

Fred
Post Reply