I want to use one specific number of a vector which is read from excel. the vector is like this.the code is as below:
sets i;
parameter a(i);
$call gdxxrw test1.xls set=i rng=A1:A2 rdim=1 par=a rng=A1:B2 rdim=1
$gdxin test1.gdx
$load i
$load a
It’s ok. but I want use a(i1) to take part in other equations, it does not work.
eg.
variable z;
equation zz ;
zz… z=e=a(i1)*2
I was told that i1 is not recognized or dimention is wrong. how to deal with this ?thank you very much.
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
zz… z=e=a(i1)*2
should be
zz… z=e=a(‘i1’)*2
–Paul
On Mon, Sep 14, 2015 at 8:56 PM, Eden Huang wrote:
I want to use one specific number of a vector which is read from excel. the vector is like this.the code is as below:
sets i;
parameter a(i);
$call gdxxrw test1.xls set=i rng=A1:A2 rdim=1 par=a rng=A1:B2 rdim=1
$gdxin test1.gdx
$load i
$load a
It’s ok. but I want use a(i1) to take part in other equations, it does not work.
eg.
variable z;
equation zz ;
zz… z=e=a(i1)*2
I was told that i1 is not recognized or dimention is wrong. how to deal with this ?thank you very much.
Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.