Hello,
I want to ask if this code is correct if I want to read data from Excel and then to put them into Gams. I want to ask if using this way Gams read zero elements too.
PARAMETER Wind(T)
$CALL GDXXRW data3.xls par=Wind rng=WDATA!A1:B289 Rdim=1
$GDXIN data3.gdx
$LOAD Wind
$GDXIN
Display Wind;
As writing from Gams to Excel I use this code.
execute_unload “4zugoi-bima1se.gdx” V.l
execute ‘gdxxrw.exe 4zugoi-bima1se.gdx var=V.l rng=V!a1’;
In this point I want to ask how I can write to excel the zero values of V variable? Any idea?
Thank you a lot.
\
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/groups/opt_out.
Hi
Why are you making my Life can so hard…?
search for “zero gdx” in the mailing list…(answered on 22.8)
Cheers
Renger
Sent from my iPhone
Am 04.11.2013 um 18:06 schrieb “saosan” :
Hello,
I want to ask if this code is correct if I want to read data from Excel and then to put them into Gams. I want to ask if using this way Gams read zero elements too.
PARAMETER Wind(T)
$CALL GDXXRW data3.xls par=Wind rng=WDATA!A1:B289 Rdim=1
$GDXIN data3.gdx
$LOAD Wind
$GDXIN
Display Wind;
As writing from Gams to Excel I use this code.
execute_unload “4zugoi-bima1se.gdx” V.l
execute ‘gdxxrw.exe 4zugoi-bima1se.gdx var=V.l rng=V!a1’;
In this point I want to ask how I can write to excel the zero values of V variable? Any idea?
Thank you a lot.
–
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/groups/opt_out.
–
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/groups/opt_out.
Hi,
Normally GAMS drops all the zero values when displaying the output. May be there are smarter ways to do it, but I just add a small value to the output value (0.0000001 for example) so that all values show up. For this, you might need to create a parameter that sums the value of your variable with this small number.
Example: if your output variable is x, then create a parameter y, such that y=x.l+0.0000001;
Hope this helps.
Yonas
On Nov 4, 2013, at 6:05 PM, saosan wrote:
execute_unload “4zugoi-bima1se.gdx” V.l
–
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/groups/opt_out.