Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Error- Matlab & Cplex

    Posted 01/04/15 04:03 AM

    Originally posted by: tl_yjq


    I have Matlab( R2007b) and Cplex 12.4 in my computer and my PC OS is Windows 7 Ultimate 64bit. I can use Matlab and Cplex separately. But I cannot use Matlab to call Cplex.

    The Cplex is 32-bit. But a friend of mine whose OS is also Windows 7 Ultimate 64bit,  has already call the Cplex124 in his Matlab 2007b. However, he forgot the specific installation method. 

    The "Set Path" in Matlab is :

    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\examples\src\matlab
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32\help
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32\help\helpsearch
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32\help\topics

    In Matlab- Product Help, I can find some examples of Cplex.

    When I choose an m file from "Examples of the Cplex Class API" and run it, then,

    Usage: lpex1(X)
    where X is one of the following options: 
    'r'          generate problem by row
    'c'          generate problem by column
    'a'          generate problem by arrays
    Exiting...
    >> lpex1('r')
    Could not open file cplexlink124.mexw64. Please update your path.

     

    When I choose an m file from "Examples of the CPLEX for MATLAB Toolbox", the command window shows that,

     

    Undefined function or method 'cplexlink124' for input arguments of type 'Cplex'.

     

    How can I use Matlab to call Cplex?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error- Matlab & Cplex

    Posted 01/05/15 05:59 AM

    Hi

    have you followed

    CPLEX > CPLEX for MATLAB > Getting started with CPLEX for MATLAB in the documentation ?

    Especially

    Configure MATLAB

    To configure MATLAB to use CPLEX, you must first add the CPLEX connector for MATLAB installation folder to your MATLAB path by using the MATLAB addpath command. For instance, the installation directory for 32-bit Windows is yourCOShome\cplex\matlab\x86_win32, where yourCOShome specifies the folder where CPLEX Optimization Studio is installed. In addition, add the folder yourCOShome\cplex\examples\src\matlab in the same manner to support navigational links to examples in the online help from within a MATLAB session.

     

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Error- Matlab & Cplex

    Posted 01/05/15 09:30 PM

    Originally posted by: tl_yjq


    Thank you. But I had already add those folders into my Matlab's Setpath:

    The "Set Path" in Matlab is :

    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\examples\src\matlab
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32\help
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32\help\helpsearch
    • E:\Program Files (x86)\IBM\ILOG\CPLEX_Studio124\cplex\matlab\x86_win32\help\topics
    •  
    •  
    • However, the Matlab still cannnot call the cplex.
    •  
    • Best wishes,‹

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Error- Matlab & Cplex

    Posted 01/06/15 03:35 AM

    The error message you showed referred to cplexlink124.mexw64 while your path settings only include 32bit directories. So this looks like a bad mix of 32bit and 64bit libraries/applications. Have you tried installing 64bit CPLEX and pointing matlab to that?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Error- Matlab & Cplex

    Posted 01/06/15 07:19 AM

    Originally posted by: tl_yjq


    Thank you.

    Actually I do not have a 64bit cplex. 

    But a friend of mine whose OS is also Windows 7 Ultimate 64bit,  has already call the Cplex124 in his Matlab 2007b. However, he forgot the specific installation method. 

    I really don't know how to work ti out :(


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Error- Matlab & Cplex

    Posted 01/06/15 09:46 AM

    Originally posted by: jack__nicolas


    You should call 32-bit CPLEX from 32-bit MATLAB( not 64-bit MATLAB), nothing to do with the OS type. 


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Error- Matlab & Cplex

    Posted 01/07/15 03:32 AM

    Originally posted by: tl_yjq


    Thank you very much.

    I have already solved this problem by installing a 32-bit Matlab.

    Best regards,


    #CPLEXOptimizers
    #DecisionOptimization