4 Installation

In this section we discuss how to install and setup the MOSEK Fusion API for Matlab.

Important

Before running this MOSEK interface please make sure that you:

  • Installed MOSEK correctly. Some operating systems require extra steps. See the Installation guide for instructions and common troubleshooting tips.
  • Set up a license. See the Licensing guide for instructions.

Compatibility

The Fusion API for Matlab can be used with MATLAB version r2014a or newer, with enabled support for Java version 1.7 or later.

Locating Files

The files in Fusion API for Matlab are organized as reported in Table 4.1.

Table 4.1 Relevant files for the Fusion API for Matlab.
Relative Path Description Label
<MSKHOME>/mosek/8/tools/platform/<PLATFORM>/bin Libraries and jar file <JARDIR>
<MSKHOME>/mosek/8/tools/examples/fusion/matlab Examples <EXDIR>
<MSKHOME>/mosek/8/tools/examples/fusion/data Additional data <MISCDIR>

where

  • <MSKHOME> is the folder in which the MOSEK package has been installed,
  • <PLATFORM> is the actual platform among those supported by MOSEK, i.e. win32x86, win64x86, linux64x86 or osx64x86.

Setting up the paths

To execute a MATLAB script using Fusion API for Matlab the correct path to <JARDIR>/mosekmatlab.jar must be provided in MATLAB‘s Java classpath. This can be set by running the following command from MATLAB:

javaaddpath <MSKHOME>/mosek/8/tools/platform/<PLATFORM>/bin/mosekmatlab.jar

Alternatively, this path may be set from the command line or it can be added to MATLAB permanently using the configuration file startup.m or from the FileSet Path menu item. We refer to MATLAB documentation for details.

4.1 Building Examples and Testing the Installation

This section describes how to verify that MOSEK has been installed correctly, and how to build and execute the Matlab examples distributed with MOSEK.

To compile the example lo1.m distributed with MOSEK:

  • Open MATLAB, set the Java library path and go to the examples directory <EXDIR>.

  • Execute the function by typing:

    lo1
    
  • Other example programs can be tested in a similar fashion.