GDXMRW: Interfacing GAMS and MATLAB

Hi,

I have been trying to interface MATLAB and GAMS using GDXMRW; following the instructions of the subject document. I have MATLAB Version 7.11.0.584 (R2010b) 64 bit and GAMS win64 23.8.2. on windows 7. I am unable to establish a successful connection though I have added the path in matlab correctly and I have also gone through the faqs and trouble shooting at http://support.gams.com/doku.php?id=matlab_and_gams:interfacing_optimization_and_visualization_software_via_the_gdxmrw_utilities#error_messageundefined_function_or_method_gams_for_input_arguments_of_type_char
but I am still getting errors like

last error message: Undefined function or method ‘gams’ for input arguments of type ‘char’.
last error identifier: MATLAB:UndefinedFunction
See testinst log file testinstlog.txt for details
??? Error using ==> testinst at 128
Error in testinst: terminating prematurely

??? Undefined function or method ‘rgdx’ for input arguments of type ‘char’.

Error in ==> r1 at 11
x = rgdx(‘read1.gdx’);

Error in ==> r_batch at 4
r1

In GAMS IDE I am getting something like this


— Job gdxmrw03.gms Start 04/15/12 22:04:19 WEX-WEI 23.8.2 x86_64/MS Windows
GAMS Rev 238 Copyright (C) 1987-2012 GAMS Development. All rights reserved
Licensee: GAMS Development Corporation, Washington, DC G871201/0000CA-ANY
Free Demo, 202-342-0180, sales@gams.com, www.gams.com DC0000
— Starting compilation
— gdxmrw03.gms(15) 2 Mb
— call =rm r1_result.gdx r2_result.gdx rfull_result.gdx rsparse_result.gdx
— gdxmrw03.gms(18) 2 Mb
— call =matlab -r r_batch -logfile r_batch.log -nosplash -nodisplay /wait
rm: r1_result.gdx: No such file or directory
rm: r2_result.gdx: No such file or directory
rm: rfull_result.gdx: No such file or directory
rm: rsparse_result.gdx: No such file or directory


I have tried everything available in document and online but still not sure what is my mistake. I am running these test from a temporary directory in C:temp\ and extracting testlib gdxmrw03, gdxmrw04, gdxmrw05 files from GAMS
I will be greatly thankful if some one could help me out.
Thank you.


Best Regards,
Zohaib Khalid

\

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.

Reply-to: gamsworld@googlegroups.com


Same error as Zohaib’s. Who can help?

On Sunday, April 15, 2012 9:09:50 PM UTC-5, Zohaib Khalid wrote:

Hi,

I have been trying to interface MATLAB and GAMS using GDXMRW; following the instructions of the subject document. I have MATLAB Version 7.11.0.584 (R2010b) 64 bit and GAMS win64 23.8.2. on windows 7. I am unable to establish a successful connection though I have added the path in matlab correctly and I have also gone through the faqs and trouble shooting at http://support.gams.com/doku.php?id=matlab_and_gams:interfacing_optimization_and_visualization_software_via_the_gdxmrw_utilities#error_messageundefined_function_or_method_gams_for_input_arguments_of_type_char
but I am still getting errors like

last error message: Undefined function or method ‘gams’ for input arguments of type ‘char’.
last error identifier: MATLAB:UndefinedFunction
See testinst log file testinstlog.txt for details
??? Error using ==> testinst at 128
Error in testinst: terminating prematurely

??? Undefined function or method ‘rgdx’ for input arguments of type ‘char’.

Error in ==> r1 at 11
x = rgdx(‘read1.gdx’);

Error in ==> r_batch at 4
r1

In GAMS IDE I am getting something like this


— Job gdxmrw03.gms Start 04/15/12 22:04:19 WEX-WEI 23.8.2 x86_64/MS Windows
GAMS Rev 238 Copyright (C) 1987-2012 GAMS Development. All rights reserved
Licensee: GAMS Development Corporation, Washington, DC G871201/0000CA-ANY
Free Demo, 202-342-0180, sa...@gams.com, www.gams.com DC0000
— Starting compilation
— gdxmrw03.gms(15) 2 Mb
— call =rm r1_result.gdx r2_result.gdx rfull_result.gdx rsparse_result.gdx
— gdxmrw03.gms(18) 2 Mb
— call =matlab -r r_batch -logfile r_batch.log -nosplash -nodisplay /wait
rm: r1_result.gdx: No such file or directory
rm: r2_result.gdx: No such file or directory
rm: rfull_result.gdx: No such file or directory
rm: rsparse_result.gdx: No such file or directory


I have tried everything available in document and online but still not sure what is my mistake. I am running these test from a temporary directory in C:temp\ and extracting testlib gdxmrw03, gdxmrw04, gdxmrw05 files from GAMS
I will be greatly thankful if some one could help me out.
Thank you.


Best Regards,
Zohaib Khalid

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/b0NzsYF85JMJ.
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.

Reply-to: gamsworld@googlegroups.com

The error message indicates that you did not set the path to GAMS in Matlab
Simple way to solve this is to look at your current directory (directory bar in MATLAB) change it to your GAMS working directory. That usually solves it for me.
That particular file you mentioned helped me solve this problem. So take it easy and rework it.

Also,
As first step, be sure to setup your connection interface correctly. Use this pdf and follow it to the letter: http://www.gams.com/dd/docs/tools/gdxmrw.pdf



On Monday, April 16, 2012 11:09:50 AM UTC+9, Zohaib Khalid wrote:

Hi,

I have been trying to interface MATLAB and GAMS using GDXMRW; following the instructions of the subject document. I have MATLAB Version 7.11.0.584 (R2010b) 64 bit and GAMS win64 23.8.2. on windows 7. I am unable to establish a successful connection though I have added the path in matlab correctly and I have also gone through the faqs and trouble shooting at http://support.gams.com/doku.php?id=matlab_and_gams:interfacing_optimization_and_visualization_software_via_the_gdxmrw_utilities#error_messageundefined_function_or_method_gams_for_input_arguments_of_type_char
but I am still getting errors like

last error message: Undefined function or method ‘gams’ for input arguments of type ‘char’.
last error identifier: MATLAB:UndefinedFunction
See testinst log file testinstlog.txt for details
??? Error using ==> testinst at 128
Error in testinst: terminating prematurely

??? Undefined function or method ‘rgdx’ for input arguments of type ‘char’.

Error in ==> r1 at 11
x = rgdx(‘read1.gdx’);

Error in ==> r_batch at 4
r1

In GAMS IDE I am getting something like this


— Job gdxmrw03.gms Start 04/15/12 22:04:19 WEX-WEI 23.8.2 x86_64/MS Windows
GAMS Rev 238 Copyright (C) 1987-2012 GAMS Development. All rights reserved
Licensee: GAMS Development Corporation, Washington, DC G871201/0000CA-ANY
Free Demo, 202-342-0180, sa...@gams.com, www.gams.com DC0000
— Starting compilation
— gdxmrw03.gms(15) 2 Mb
— call =rm r1_result.gdx r2_result.gdx rfull_result.gdx rsparse_result.gdx
— gdxmrw03.gms(18) 2 Mb
— call =matlab -r r_batch -logfile r_batch.log -nosplash -nodisplay /wait
rm: r1_result.gdx: No such file or directory
rm: r2_result.gdx: No such file or directory
rm: rfull_result.gdx: No such file or directory
rm: rsparse_result.gdx: No such file or directory


I have tried everything available in document and online but still not sure what is my mistake. I am running these test from a temporary directory in C:temp\ and extracting testlib gdxmrw03, gdxmrw04, gdxmrw05 files from GAMS
I will be greatly thankful if some one could help me out.
Thank you.


Best Regards,
Zohaib Khalid

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/rQGUZGr_49oJ.
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.

Reply-to: gamsworld@googlegroups.com

Hi,

Recently I have been suffering a lot from this error. But finally I found the reason. I don’t know if you have already solved it. But I wish I could help anyone who gets in here because of this tiny but frustrating mistake. The path in Matlab should be set as ‘C:\GAMS\win64\23.9’ instead of simply ‘C:\GAMS’ which is recommended in the GAMS wiki and that pdf file by Ferris. If you are using win32 system or other version of GAMS, the corresponding change in the path should be made as well. Hope it helps.

Best,

On Sunday, April 15, 2012 7:09:50 PM UTC-7, Zohaib Khalid wrote:

Hi,

I have been trying to interface MATLAB and GAMS using GDXMRW; following the instructions of the subject document. I have MATLAB Version 7.11.0.584 (R2010b) 64 bit and GAMS win64 23.8.2. on windows 7. I am unable to establish a successful connection though I have added the path in matlab correctly and I have also gone through the faqs and trouble shooting at http://support.gams.com/doku.php?id=matlab_and_gams:interfacing_optimization_and_visualization_software_via_the_gdxmrw_utilities#error_messageundefined_function_or_method_gams_for_input_arguments_of_type_char
but I am still getting errors like

last error message: Undefined function or method ‘gams’ for input arguments of type ‘char’.
last error identifier: MATLAB:UndefinedFunction
See testinst log file testinstlog.txt for details
??? Error using ==> testinst at 128
Error in testinst: terminating prematurely

??? Undefined function or method ‘rgdx’ for input arguments of type ‘char’.

Error in ==> r1 at 11
x = rgdx(‘read1.gdx’);

Error in ==> r_batch at 4
r1

In GAMS IDE I am getting something like this


— Job gdxmrw03.gms Start 04/15/12 22:04:19 WEX-WEI 23.8.2 x86_64/MS Windows
GAMS Rev 238 Copyright (C) 1987-2012 GAMS Development. All rights reserved
Licensee: GAMS Development Corporation, Washington, DC G871201/0000CA-ANY
Free Demo, 202-342-0180, sa...@gams.com, www.gams.com DC0000
— Starting compilation
— gdxmrw03.gms(15) 2 Mb
— call =rm r1_result.gdx r2_result.gdx rfull_result.gdx rsparse_result.gdx
— gdxmrw03.gms(18) 2 Mb
— call =matlab -r r_batch -logfile r_batch.log -nosplash -nodisplay /wait
rm: r1_result.gdx: No such file or directory
rm: r2_result.gdx: No such file or directory
rm: rfull_result.gdx: No such file or directory
rm: rsparse_result.gdx: No such file or directory


I have tried everything available in document and online but still not sure what is my mistake. I am running these test from a temporary directory in C:temp\ and extracting testlib gdxmrw03, gdxmrw04, gdxmrw05 files from GAMS
I will be greatly thankful if some one could help me out.
Thank you.


Best Regards,
Zohaib Khalid

\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\