Connect matlab with ampl

Hi, I’m having a problem trying to use AMPL from Matlab.
I am using the following line of code:
ampl = AMPL(‘“C:\amplbundle.mswin64\ampl.mswin64\amplide\amplide.exe”’);
To connect the Matlab API with AMPL, this line manages to open AMPL, but it never exits this command, Matlab keeps executing it and does not continue with the code.

Has anyone else had this problem.
thank you

1 Like

Hi @Tania_Castellanos,

You need to specify the path to ampl.exe (the AMPL interpreter), not amplide.exe (the AMPL IDE). The following should work:

ampl = AMPL('C:\amplbundle.mswin64\ampl.mswin64\ampl.exe');
1 Like

Thank you very much, I didn’t know this. :smile:

1 Like