ve1001
ve1001

Reputation: 183

Issue with CPLEX installation for Matlab

I'm a student currently looking to use the IBM CPLEX solver within MATLAB. I downloaded CPLEX from the IBM website using my student account.

I'm currently having issues with setting up the CPLEX Matlab connector. Matlab currently tells me that CPLEX is not installed or the license server is down when I run commands using CPLEX.

The general online instructions are to add the connecter by using the command in Matlab:

addpath('<CPLEX_Optimization_Studio>/cplex/matlab/')

However, when installed, there wasn't a folder entitled 'matlab' within the cplex folder, and so it can't be added to the MATLAB path.

folder not found after installation

I'm not sure if there's an issue with the version of CPLEX that I installed, or if this is a common error that can occur during installation.

Please let me know if there's a step I can take to fix this issue!

Upvotes: 1

Views: 1646

Answers (1)

Alex Fleischer
Alex Fleischer

Reputation: 10077

Matlab connector was removed in CPLEX 20.1

So what you can do:

keep using CPLEX 12.10

call OPL from Matlab :

https://github.com/AlexFleischerParis/howtowithopl/blob/master/callfrommatlab.M

https://github.com/mjbays/MATLAB-OPL-Interface

export MPS from Matlab with https://www.mathworks.com/matlabcentral/fileexchange/19618-mps-format-exporting-tool and then call CPLEX

use a Matlab connector like TOMOPT https://tomopt.com/

Or you can also

use the MATLAB connector from CPLEX 12.10 and export the mps file with

The parameter ExportModel (or exportmodel) takes a file name as an argument. The default is the empty string (""). For example, opt = cplexoptimset('exportmodel', 'myModel.lp'); can be used to set the name of the exported model.

then call CPLEX from Matlab through a command line call

Upvotes: 3

Related Questions