hi any one

Hi
i am attemting to export my results from GAMS to MATLAB.
i read the “GDX Intyerface” in GAMS help but i became confused.
does any one try it?
i feel so pleasure if any one send me a simple example of that.
please dont refer me to any user manual.

thanks
Regards
m.amini


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Mr. Mehdi
Please Follow steps:
1-First provide the newest versions of both GAMS(www.gams.com) and Matlab(2010 or later version). in this versions you can link them easily.
2- In the main menu of Matlab you should add the path of Gams location.
3- E-mail me to send you a simple cod which can help you in this way.
Please send your message to:“7arbahari+GAMS@gmail.com” (+ is inserted correctly, don’t change it) or 09192902179
Best…
A. Bahari

On Mon, Nov 28, 2011 at 6:35 PM, Mehdi Amini wrote:

Hi
i am attemting to export my results from GAMS to MATLAB.
i read the “GDX Intyerface” in GAMS help but i became confused.
does any one try it?
i feel so pleasure if any one send me a simple example of that.
please dont refer me to any user manual.

thanks
Regards
m.amini


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi there,

I am new in this topic, but this works for me on the new GAM’s version(23.7.3) and matlab 2010

First add matlab path to the GAMS folder

addpath ‘C:\gams’; savepath;

After the solve statement in gams, crate result.gdx with values of v1 v2 … you want to export:

execute_unload ‘reuslt’ v1 v2 OF;

Then you can read this result in matlab from the gdx file using:

res=rgdx(‘name’, ‘form’, ‘full’);

res.name = ’ v1’;
res.field = ’ l '; % l is for level, m is for marginal values …
r=rgdx(‘result’, res);
v1=r.val;

res.name = ’ v2’;
res.field = ’ l ';
r=rgdx(‘result’, res);
v2=r.val;

I’ve referred to the document:
http://www.gams.com/dd/docs/tools/gdxmrw.pdf
and an example can be found
http://www.gams.com/~steve/gdxmrw.html

You can also find a similar thread in this group:
http://groups.google.com/group/gamsworld/browse_thread/thread/721274c4dbf76464/5bca6ba9337171dd?hl=en&lnk=gst&q=gams+matlab#5bca6ba9337171dd

Hope this helps!


On Mon, Nov 28, 2011 at 4:05 PM, Mehdi Amini wrote:

Hi
i am attemting to export my results from GAMS to MATLAB.
i read the “GDX Intyerface” in GAMS help but i became confused.
does any one try it?
i feel so pleasure if any one send me a simple example of that.
please dont refer me to any user manual.

thanks
Regards
m.amini


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

hi
i Appreciate your attemption for the time that has been elapsed.
i want to employ GAMS from matlam during a “For” loop( for i=1:100 …).
the file that you had sent just call the exquted results from GAMS to matlab.
i will be ashamed if you send a simple example of that.
thanks very much

From: Muhajir
To: gamsworld@googlegroups.com
Sent: Tuesday, November 29, 2011 1:24 AM
Subject: Re: hi any one

Hi there,

I am new in this topic, but this works for me on the new GAM’s version(23.7.3) and matlab 2010

First add matlab path to the GAMS folder

addpath ‘C:\gams’; savepath;

After the solve statement in gams, crate result.gdx with values of v1 v2 … you want to export:

execute_unload ‘reuslt’ v1 v2 OF;

Then you can read this result in matlab from the gdx file using:

res=rgdx(‘name’, ‘form’, ‘full’);

res.name = ’ v1’;
res.field = ’ l '; % l is for level, m is for marginal values …
r=rgdx(‘result’, res);
v1=r.val;

res.name = ’ v2’;
res.field = ’ l ';
r=rgdx(‘result’, res);
v2=r.val;

I’ve referred to the document:
http://www.gams.com/dd/docs/tools/gdxmrw.pdf
and an example can be found
http://www.gams.com/~steve/gdxmrw.html

You can also find a similar thread in this group:
http://groups.google.com/group/gamsworld/browse_thread/thread/721274c4dbf76464/5bca6ba9337171dd?hl=en&lnk=gst&q=gams+matlab#5bca6ba9337171dd

Hope this helps!


On Mon, Nov 28, 2011 at 4:05 PM, Mehdi Amini wrote:

Hi
i am attemting to export my results from GAMS to MATLAB.
i read the “GDX Intyerface” in GAMS help but i became confused.
does any one try it?
i feel so pleasure if any one send me a simple example of that.
please dont refer me to any user manual.

thanks
Regards
m.amini

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.