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:
However, in this case, the table will contain zeros for the rest of the rows (as they are not initialized.
You can use a subset of rows (and not a new set):
set subr(rows) /r1*r10/;
Parameter Y(rows,cols);
y(srows,cols) = x(srows, cols);
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.