hey guys,
I am trying to call GAMS from a MATLAB code. I have done this a lot of times before, but this time it returns an error that I cannot solve it.
MATLAB returns the error below:
Error using gams
Could not write data with gdxDataWriteMapStart
Error in UIMA_GAMS (line 51)
gams('UIMA_GAMS_Function.gms',vs,bs,ts,A,I,RD,cHT,cWT,cLD,Dv,Lv,Pv,Ph,Db,Lb,HT);
My files have been attached. It would be greatly appreciated if you check it and help me. As I cannot attach an m-file here, I changed the extension of the file UIMA_GAMS.m to .gms and attach it. Please kindly change the extension to .m to use the file.
Thank you
Masoud
Running GAMS from MATLAB
-
- User
- Posts: 5
- Joined: 5 years ago
Running GAMS from MATLAB
- Attachments
-
- UIMA_GAMS.gms
- (64.38 KiB) Downloaded 262 times
-
- UIMA_GAMS_Function.gms
- (2.65 KiB) Downloaded 252 times
Re: Running GAMS from MATLAB
Masoud,
I would advise you not to use the gams Mex-function. It's nice when it works, but if there is any error - and the error state is the normal state when you're developing a model or source code anywhere - it doesn't help you find and fix the error. In your example, where should you start looking? The Matlab code? The GAMS source you wrote? The GAMS source written by the gams Mex-function?
You can find some suggestions - I would say good and helpful ones - about a better way to do this on the GAMS wiki page about GDXMRW:
https://support.gams.com/matlab_and_gam ... and_matlab
BTW, if you choose to persist in using the gams Mex-function, you should start by removing the space from the name of the Pv and Ph parameters. This won't work:
HTH,
-Steve
I would advise you not to use the gams Mex-function. It's nice when it works, but if there is any error - and the error state is the normal state when you're developing a model or source code anywhere - it doesn't help you find and fix the error. In your example, where should you start looking? The Matlab code? The GAMS source you wrote? The GAMS source written by the gams Mex-function?
You can find some suggestions - I would say good and helpful ones - about a better way to do this on the GAMS wiki page about GDXMRW:
https://support.gams.com/matlab_and_gam ... and_matlab
BTW, if you choose to persist in using the gams Mex-function, you should start by removing the space from the name of the Pv and Ph parameters. This won't work:
Code: Select all
Pv.name=' Pv';
-Steve
-
- User
- Posts: 5
- Joined: 5 years ago
Re: Running GAMS from MATLAB
Hi, Steve.
Thank you so much for your attention. My problem was about that space that you correctly have mentioned. I should have been more attentive.
Thank you again
Masoud
Thank you so much for your attention. My problem was about that space that you correctly have mentioned. I should have been more attentive.
Thank you again
Masoud