This MATLAB toolbox provides an interface to CVXOPT's cone LP solver.
CVXOPT website: http://cvxopt.org
CVXOPT license: GPL 3
Toolbox license: BSD 3-Clause
- Supported platforms: macOS, Linux
- MATLAB R2014b or later
- Python environment with CVXOPT 1.1.9 or later
The version of the Python interpreter used by MATLAB can be changed with the pyversion
function.
The Linux version of MATLAB may crash when calling the toolbox function conelp
because of a library conflict: MATLAB's MKL library is used in place of the BLAS library that CVXOPT otherwise uses when loaded in Python, causing a segmentation fault. This issue is similar to the library conflict reported in this thread on MATLAB Answers, and the same workarounds seem to work. In particular, by executing py.sys.setdlopenflags(int32(10))
before Python is loaded, the library conflict is avoided. The toolbox includes a script that will do this if the platform is Linux:
>> cvxopt_init
This script should be executed before Python is loaded (see pyversion
).
On MATLAB’s Home tab, click on "Add-Ons" and select “Get Add-Ons”. This will open the Add-On Explorer. Search for "CVXOPT Toolbox" and click on "Add".
Double-click on CVXOPT Toolbox.mltbx
and click on the "Install" button.
git clone https://github.com/cvxopt/cvxopt-matlab
cd cvxopt-matlab
make install
If MATLAB is not available in the path, set MATLAB_ROOT
to the root directory of your MATLAB installation (the appropriate path can be found with MATLAB's matlabroot
function), i.e.,
make MATLAB_ROOT=/path/to/matlabroot install
On MATLAB’s Home tab, click on "Add-Ons" and select "Manage Add-Ons". Locate the CVXOPT Toolbox and select "Uninstall..." from the drop-down menu.
To check that the toolbox has been properly installed and is working, run the cvxopt_test
script:
>> cvxopt_test
On MATLAB’s Home tab, click on "Add-Ons" and select "Manage Add-Ons". Locate the CVXOPT Toolbox and select "View Getting Started Guide" from the drop-down menu. Alternatively, open the MATLAB Live Script located in doc/Getting Started Guide.mlx
. The "Getting Started Guide" is also available online here.
The conelp
function
sol = conelp(c,G,h,dims,A,b,options);
solves a cone linear program. Basic information about how to use the conelp
function is included in the help text:
>> help conelp
Some examples of how to use conelp
are included in the examples
directory.
For more information about how to use CVXOPT and additional examples, see the userguide.