Originally posted by: John Cui
You need add the path of CPLEX-MATLAB to MATLAB's path:
>>addpath('c:\ILOG\CPLEX121\matlab\x86_win32\')
After above addpath, you can new Cplex object on matlab, to solve your problem; and also, you can call our toolbox functions to solve your problem. Such as:
>> cplex=Cplex()
ans=
Cplex handle
Properties:
Model: [1x1 struct]
Param: [1x1 struct]
DisplayFunc: @disp
Methods, Events, Superclasses
>> cplex.addCols(1)
ans=
Cplex handle
Properties:
Model: [1x1 struct]
Param: [1x1 struct]
DisplayFunc: @disp
Methods, Events, Superclasses
>> cplex.solve
Tried aggregator 1 time.
LP Presolve eliminated 0 rows and 1 columns.
All rows and columns eliminated.
Presolve time = 0.00 sec.
ans =
status: 1
statusstring: 'optimal'
time: 0
objval: 0
x: 0
method: 2
reducedcost: 1
basis: [1x1 struct]
If you want to run CPLEX examples in MATLAB at any directory, you need to add the path of CPLEX-MATLAB examples to MATLAB's path:
>>addpath('c:\ILOG\CPLEX121\examples\src\matlab')
then you can run our examples, such as
>> cplexlpex
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time = 0.00 sec.
Iteration log . . .
Iteration: 1 Dual infeasibility = 0.000000
Iteration: 2 Dual objective = -202.500000
Solution status = optimal
Solution value = -202.500000
Values =
40.0000
17.5000
42.5000
#CPLEXOptimizers#DecisionOptimization