Compiling MATLAB with YALMIP and CPLEX error: undefined function 'handleparams'

322 views
Skip to first unread message

Sander Stelt

unread,
Jun 5, 2017, 4:00:42 PM6/5/17
to YALMIP
Dear Sir,

I'm trying to compile a standalone executable which is to be send to an external server for calculations.
I'm using matlab R2016b and the latest CPLEX and YALMIP

 mcc -mv Scenario2.m -I /allyalmipdirectories/ -I  /CPLEX_Studio/cplex/matlab/x86-64_linux -a /call_cplexibm_qcmiqp.m -a /cplexqcp.m -a /cplexlink1271.mexa64

Compiling creates no errors, also 
which cplex
which cplex1271.mexa64
which yalmip

produce the following:
/CPLEX_Studio/cplex/matlab/x86-64_linux/@Cplex/Cplex.p  % Cplex constructor
/CPLEX_Studio/cplex/matlab/x86-64_linux/cplexlink1271.mexa64
yalmip-master/extras/yalmip.m

It seems at least both YALMIP and CPLEX are located in the compiled program.
However, the solver is not working 
 ./Scenario2

sol =

  struct with fields:

    yalmiptime: NaN
    solvertime: NaN
          info: 'Unknown problem in solver (Turn on 'debug' in sdpsettings...'
       problem: 9

Mincosts =

   NaN

Debug results point towards the following:

Undefined function or variable 'handleparams'.

Error in cplexmilp

Error in call_cplexibm_miqp>localSolverCall (line 164)

Error in call_cplexibm_miqp (line 27)

Error in call_cplexibm_qcmiqp (line 11)

Error in solvesdp (line 350)

Error in optimize (line 31)

Error in Scenario2 (line 231)

Am I missing a path here? I don't really know what handleparams means in this case. Could you help me?



Johan Löfberg

unread,
Jun 6, 2017, 3:51:18 AM6/6/17
to YALMIP
>> which handleparams -all
C:\Program Files\IBM\ILOG\CPLEX_Studio1261\cplex\matlab\x64_win64\private\handleparams.p  % Private to x64_win64
C:\Program Files\IBM\ILOG\CPLEX_Studio1261\cplex\matlab\x64_win64\private\handleparams.m  % Shadowed and private to x64_win64

Sander Stelt

unread,
Jun 6, 2017, 6:43:32 AM6/6/17
to YALMIP
I've added handeparams.m to the compiler: -a /directory/handleparams/m
Now the following error occurs:

Error using cplexlp
Output argument "newOptions" (and maybe others) not assigned during call to "handleparams".

Error in call_cplexibm_miqp>localSolverCall (line 147)


Error in call_cplexibm_miqp (line 27)


Error in call_cplexibm_qcmiqp (line 11)


Error in solvesdp (line 350)


Error in optimize (line 31)


Error in Smart_Charging (line 88)

MATLAB:unassignedOutputs

Any ideas?

Johan Löfberg

unread,
Jun 6, 2017, 7:21:08 AM6/6/17
to YALMIP
Nope. 

Sander Stelt

unread,
Jun 6, 2017, 7:56:04 AM6/6/17
to YALMIP
That's too bad. Anyway, thank you for your time.
I guess i'll try the normal MATLAB solver instead (linprog).


Cong Chen

unread,
Dec 10, 2019, 11:20:23 AM12/10/19
to YALMIP
I've also meet the same problem. May I ask if you have find some solutions to use Cplex in Matlab on Mac later?
Here is the information of my CPLEX, YALMIP and MATLAB


>> which cplex
/Applications/CPLEX_Studio128/cplex/matlab/x86-64_osx/@Cplex/Cplex.p  % Cplex constructor
>> which cplexlink1280.mexmaci64
/Applications/CPLEX_Studio128/cplex/matlab/x86-64_osx/cplexlink1280.mexmaci64
>> which yalmip
/Users/cong_mac/Documents/MATLAB/YALMIP-master/extras/yalmip.m
>> 
Reply all
Reply to author
Forward
0 new messages