How can I connect MATLAB to GAMS?

15 views (last 30 days)
Ronny Martin
Ronny Martin on 23 Aug 2021
Commented: Cris LaPierre on 22 Aug 2024
My aim is to import selected data from a GAMS *.gdx-file to MATLAB and vice versa. It seems that there was a workflow that worked (at least in the past). I found a few older posts on this matter but it does not work for me. Especially I wonder whether the MATLAB-commands "rgdx/wgdx" have been removed from MATLAB as I can't find information in the online documentation.
I am running GAMS Studio 36 and MATLAB R2020b on a Macbook Air 2017.
Thank you for any useful suggestions.
  2 Comments
Vicente Marin Marti
Vicente Marin Marti on 21 Aug 2024
I am using the most current versions of GAMS and Matlab. From what I understand, if I follow the steps mentioned in the document you provided, I should be able to use the functions you mentioned. However, I have done this and still cannot use the 'gams' function. When I try to run this function, it appears as if it doesn't exist. Could it be that I need to use specific previous versions of Matlab and GAMS to access this 'gams' function? Which versions would those be, and do you know how to obtain them? Your help would be greatly appreciated.
On another note, @Ronny Martin, if you have any recommendations or can provide information on using the 'gams' function, I would be very grateful.
Cris LaPierre
Cris LaPierre on 22 Aug 2024
Normally, this would happen if the folder containg the functions has not been added to your MATLAB path. However, since this is a 3rd party tool, I can't say for certain. All I can suggest is that you double check that you have followed the installation instructions correctly. They make no mention of needing to use a specific version of MATLAB.
The page I linked to before contains links to some YouTube videos that may be helpful. If the issue perists, consider reaching out to the authors of GAMS.

Sign in to comment.

Answers (1)

Cris LaPierre
Cris LaPierre on 23 Aug 2021
Moved: Cris LaPierre on 21 Aug 2024
Note that rgdx is not a function created by MathWorks. It appears to be a utility function included in GAMS.
"From version 23.4 of GAMS onwards, all the Matlab/GAMS utilities (rgdx, wgdx, and gams) previously documented and made available online are fully integrated into the GAMS distribution, so no separate downloads are necessary."
  1 Comment
Ronny Martin
Ronny Martin on 7 Sep 2021
Moved: Cris LaPierre on 21 Aug 2024
Thank you, Cris. This was exactly the information I was looking for. With the tutorial videos everything has been quickly set up und runs now pretty well. :-)

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!