Matlab

OSQP Matlab interface requires Matlab 2015b or newer.

Binaries

Precompiled platform-dependent Matlab binaries are available on GitHub.

To install the interface, just run the following commands:

websave('install_osqp.m','https://raw.githubusercontent.com/osqp/osqp-matlab/master/package/install_osqp.m');
install_osqp

Sources

You need to install the following (see Build from sources for more details):

After you install both, check that your compiler is selected by executing

mex -setup

Note

Windows: If Matlab does not find TDM-GCC, you need to set the environment variable MW_MINGW64_LOC as follows

setenv('MW_MINGW64_LOC', 'C:\TDM-GCC-64')

where C:TDM-GCC-64 is the installation folder for TDM-GCC.

You can now build the interface by running inside Matlab

!git clone --recurse-submodules https://github.com/osqp/osqp-matlab
cd osqp-matlab
make_osqp

Then you can add the interface to the search path by executing from the same directory

addpath(pwd)
savepath