Hello Friends,

I’ve recently started trying my hands on GAMS/MATLAB data exchange.

I’ve been able to use rgdx and wgdx successfully but I’m currently

having problem with havign GAMS read the structured input correctly.

For example: I created 2 input structures into an inputfile.gdx in

MATLAB

indata1 = struct(‘name’,‘a’,‘type’,‘Parameter’,‘form’,‘full’,‘val’,

[350, 600],‘ts’,‘capacity’);

indata2 = struct(‘name’,‘b’,‘type’,‘Parameter’,‘form’,‘full’,‘val’,

[325 300 275],‘ts’,‘demand’);

wgdx(‘indata.gdx’,indata1,indata2)

Then In GAMS I tried to read the parameters:

:

:

Parameters

a(i) capacity of plant i in cases

b(j) demand at market j in cases

execute_load ‘indata.gdx’, a, b;

display a,b;

:

:

The code compiled successfully but gives the following error on

execution.

E x e c u t i o n

---- 55 PARAMETER a capacity of plant i in cases

( ALL 0.000 )

---- 55 PARAMETER b demand at market j in cases

( ALL 0.000 )

I suspect the problem is with my val field but I can’t wrap my brain

around the exact problem.

I need to pass both vector and 2D matrix into the system so I should

figure out how to make this simple one work.

Any help will be deeply appreciated.

Thanks.

\