Setting up CPLEX for MATLAB

Install and configure IBM® ILOG® CPLEX® Optimization Studio before you use the CPLEX connector for MATLAB.

Install CPLEX

Before you begin to use the CPLEX connector for MATLAB, you must first install and configure CPLEX Optimization Studio and CPLEX Optimizer.

By default, the CPLEX Optimization Studio installer automatically installs the CPLEX connector for MATLAB in a standard location. For instance, the installation directory for CPLEX for MATLAB for a Windows 64-bit operating system is yourCOShome\cplex\matlab\x64_win64, where yourCOShome specifies the folder where CPLEX Optimization Studio is installed. Other platforms have similar installation directories, named appropriately.

Verify the service pack

When CPLEX Optimization Studio is installed on Windows operating systems, the appropriate Microsoft Visual C++ Redistributable Package must also be installed. This package installs runtime components of Visual C++ Libraries that are required to run applications that are developed with Visual C++ on a computer that does not have Visual C++ installed. If the CPLEX Optimization Studio installer detects that this package is not already installed, the installer explains how to download the service pack manually. For more information, see the Detailed System Requirements (DSR).

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 64-bit Windows is yourCOShome\cplex\matlab\x64_win64, 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.