Search found 3 matches

by cardyn
4 years ago
Forum: Syntax
Topic: How to extract part of a table data and assign it to another table parameter
Replies: 2
Views: 3437

Re: How to extract part of a table data and assign it to another table parameter

Hi Renger, Thank you very much for your excellent answers. Here I have another solution after I worked for several hours on this problem. Hope it can also help in case someone need it. Parameter X(rows,cols); Parameter Y(subr,cols); loop((rows,subr)$ [ord(rows)=ord(subr)], Y(subr,cols)=X(rows, cols)...
by cardyn
4 years ago
Forum: Syntax
Topic: how to get any element from a set
Replies: 4
Views: 12514

Re: how to get any element from a set

Hi Renger, when I assign an element of a parameter to a scalar, error happens with "Uncontrolled set entered as constant" and "Set for 'ord' is not controlled" Set A /a1,a2/; parameter h(a) /a1*a2 2/; scalar y /0/; y=h(a)$(ord(a) = 1); Could you please tell where the problem is? ...
by cardyn
4 years ago
Forum: Syntax
Topic: How to extract part of a table data and assign it to another table parameter
Replies: 2
Views: 3437

How to extract part of a table data and assign it to another table parameter

Hi everyone, I am new to GAMS. I got a problem about assignment in GAMS. I have a table data X(rows,cols) , how can I extract part of it (e.g. the first 10 rows) and assign it to another table parameter Y(subr,cols) ? For example: Sets rows /r1*r100/ cols /c1*c4/ subr /sr1*sr10/; Table X(rows,cols) ...