How can I call cplex from matlab? And what versions of matlab and cplex should I have inorder to do so?

 Accepted Answer

yekdane  khattara
yekdane khattara on 21 Dec 2013
Edited: Walter Roberson on 28 May 2018
add the path who you are installed cplex
>> addpath ('C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\matlab\x64_win64')
and save the path
>>savepath
and same way for running the examples
>>addpath ('C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\examples\src\matlab')
>>savepath

3 Comments

Del
Del on 3 Jan 2014
Edited: Del on 3 Jan 2014
I have the same issue, I tried adding the path and saving it, but it does not work. This is what I am getting:
>>addpath C:\Program Files\IBM\ILOG\CPLEX_Studio126\cplex\matlab\x64_win64
Warning: Name is nonexistent or not a directory: C:\Program
> In path at 110
In addpath at 87
Warning: Name is nonexistent or not a directory:
Files\IBM\ILOG\CPLEX_Studio126\cplex\matlab\x64_win64
> In path at 110
In addpath at 87
When I type in >>cplexlpex, I am getting the error:
Undefined function or variable 'cplexoptimset'.
I am not sure what is wrong here.
Del
Del on 3 Jan 2014
Edited: Walter Roberson on 24 Dec 2017
Never mind! I used
>>addpath(' C:\Program Files\IBM\ILOG\CPLEX_Studio126\cplex\matlab\x64_win64')
instead of
>>addpath C:\Program Files\IBM\ILOG\CPLEX_Studio126\cplex\matlab\x64_win64
and everything worked perfectly fine :)
Thank you!

Sign in to comment.

More Answers (1)

Khyathi Mishra
Khyathi Mishra on 4 Apr 2021

0 votes

You must have IBM CPLEX OPTIMIZATION STUDIO 12.10 version
the versions released after that doesnt have files related to interfacing matlab with cplex.

1 Comment

Do you know which version of matlab is compatible with Cplex 12.10 Thhank you

Sign in to comment.

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!