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.
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:
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: