Robert Franzoi
Robert Franzoi

Reputation: 1

How to extract an array from a matrix in GAMS?

i'm trying to extract an array from a matrix in GAMS. For example, i want an array that is just one column (or one row) of the matrix. Is possible to do it?

Upvotes: 0

Views: 368

Answers (1)

Erwin Kalvelagen
Erwin Kalvelagen

Reputation: 16724

Of course.

Sets 
   i /i1*i100/
   j /j1*j100/
;
parameter a(i,j);
a(i,j) = uniform(0,1);
parameter u(i);
u(i) = a(i,'j25');
parameter v(j);
v(j) = a('i37',j);

Upvotes: 1

Related Questions