Getting started

On this page you can download the latest version of OpenOCL. You can find older versions here.

Windows (Matlab >= R2013a), Linux (Matlab >= R2014a), Mac (Matlab >= R2015a)
Download Matlab .mltbx package

If your configuration is not in the list or if you would like to try an alternative way, see below.

With the Matlab .mltbx package you are ready to go, just double click on the file and Matlab will install the packages as an Add-on.

Then run an example by typing


in your command window.

If the file ending .mltbx is not associated with Matlab, open Matlab navigate to the .mltbx file, and right click within Matlab on the file and install the toolbox.

Installing .mltbx Matlab toolbox

During the first run, the toolbox will ask to download necessary software (CasADi). Confirm by hitting [enter].

First run confirmation message

Then these two plots should show up:

First run cart pole plots

To have a look at the code, type

open ocl.examples.cartpole

Open Cartpole example code

To see documentation, type

doc ocl

Matlab code as zip

You can also download the Matlab code as zip, you need to unzip the downloaded folder, and navigate to it. Then run an example, e.g.


If you would like to save your path using savepath or the Matlab path manager, add the main folder of OpenOCL without subfolders, and save the path. It is best to save the path before running OpenOCL so that the sub-directories of OpenOCL will not be saved to the path (by executing ocl scripts, some folder will be added to the path).

Other configurations

If you have another configuration (e.g. Octave) you need to setup CasADi manually.

Here is a step-by-step guide:

If you would like to save your path using savepath or the Matlab path manager, do this before running the example in order to not include the sub-directories.

Let us know if you run into any problems at!