There are (at least) two ways to export data from Matlab and loading them into GAMS: using a CSV file or using a GDX file. Here is a small comparison with a large matrix (4 million entries):
| CSV file | GDX file |
Matlab | m=2000; n=2000; A=rand(m,n);
| m=2000; n=2000; A=rand(m,n);
p.name = 'A'; p.type = 'parameter'; p.val = A; p.form = 'full';
path('c:\gams\win64\24.0',path); wgdx ('c:\projects\tmp2\data.gdx', p);
|
Time | 3.85 seconds | 4.2 seconds |
GAMS | table a(*,*) | parameter a(*,*); |
Time | 0.72 seconds | 0.69 seconds |
The timings are similar. As always the timings need to be taken with a grain of salt.