MATLAB is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages such as C, C++, and Fortran.

The MATLAB home page is at

Available modules

Packages with modules

Module NeSI Cluster
MATLAB/2016b pan
MATLAB/2012b pan
MATLAB/2013a pan
MATLAB/2015b pan

Licence information


MATLAB is made available to researchers under commercial licence agreements with individuals, research groups, departments, faculties or institutions. Whether you have access to MATLAB, which versions you have access to, and under what conditions, will vary depending on where you work or study. You will only be permitted to access and use any given version of MATLAB on any NeSI cluster if you have a valid licence to use that version of MATLAB at your place of work or study, and if the terms of your licence permit cluster use. If you have any questions regarding your eligibility to access MATLAB or any particular version of it, please contact our support desk.

Licence rationing

Some institutions only have a limited number of MATLAB licence tokens. To ensure that there are always enough of these tokens remaining for interactive work and for scheduled jobs to start sucessfully, we request that users from the following institutions inform Slurm of their jobs' licence requirements:

  • Massey University: #SBATCH --licenses=massey_matlab:1
  • University of Auckland, Faculty of Engineering: #SBATCH --licenses=eng_matlab:1
  • University of Auckland, Faculty of Science: #SBATCH --licenses=sci_matlab:1

The number after the colon (1 in the above examples) is the number of licence tokens that particular job requires.

Licence status

If you get an error message indicating that no licenses are available for a certain feature, you can use a command like the following to check the licensing situation. The output will show you the licensing situation for individual features.

lmutil lmstat -a

Example script for the Pan cluster

#!/bin/bash -e

#SBATCH --job-name      MATLAB_job
#SBATCH --account       nesi99999
#SBATCH --time          01:00:00
#SBATCH --cpus-per-task 5
#SBATCH --mem-per-cpu   2G
#SBATCH --output        MATLAB_job.%j.out # Include the job ID in the names
#SBATCH --error         MATLAB_job.%j.err # of the output and error files

module load MATLAB/2015b

srun matlab -nodisplay -r MATLAB_job.m


For MATLAB jobs the number of Slurm tasks (--ntasks) should always be 1, but if given the necessary resources some MATLAB functions can make use of multiple threads (--cpus-per-task) or GPUs (--gres gpu). If you use the higher-level parpool-based language constructs such as spmd and parfor MATLAB will make temporary files under your home directory (in ~/.matlab/local_cluster_jobs) for communication with worker processes. To prevent simultaneous such parallel MATLAB jobs from interfering with each other you can use: HOME=$SHM_DIR matlab ....


Powered by Zendesk