Calling GAMS from MATLAB

738 views
Skip to first unread message

Ish

unread,
Apr 20, 2015, 9:53:55 AM4/20/15
to gams...@googlegroups.com
Hi,

I want to call GAMS from Matlab and I referred to the following video for my reference:



I was able to install GAMS software as suggested in the video, I added GAMS to the path in Matlab. However, when I type this in Mallab: system 'gams ? lo=3' or system 'gams trnsport lo=3' I get a message from Matlab:

'gams' is not recognized as an internal or external command, operable program or batch file.

ans = 1


Could someone kindly help me with this issue.

Thanks

Anjuli Jain Figueroa

unread,
Apr 20, 2015, 10:28:45 AM4/20/15
to gams...@googlegroups.com
Hi Ish,

  I had some trouble when I first started interfacing Matlab and GAMS. It has been a while, and although I don't remember if I had the exact same problem as you, these are a few things to check:

1- In addition to adding the path to Matlab, I had to add it to the computers "environment variables" (through control panel)
2- Both Matlab and Gams had to be the same 64-bit versions.
3- I used Matlab's system() function like this: rc = system ('gams ModelName.gms lo=2 solver=path");
4 - Here are a few additional sources that helped me:



Hope some of this can help!

Best,
Anjuli

--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.



--
Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology

Ish

unread,
Apr 20, 2015, 10:55:17 AM4/20/15
to gams...@googlegroups.com, aja...@mit.edu
Hi Anjuli,

Thank you for the prompt reply. Issue was that I had to manually add GAMS path in the system variable path. I added it to the computer "environment variables" (through control panel). Thank you for your suggestion. It is working now. :)

Ish 
Reply all
Reply to author
Forward
0 new messages