MATLAB and Simulink for technical computing and model-based design.

Documentation

MATLAB home page
Vendor page for getting started with MATLAB
MATLAB Q&A site

Licenses

NCI provides a site license providing access to MATLAB, Simulink, and a considerable number of toolboxes. These are all available on the FRCE cluster. The Service Now page provides information on requesting software installs on the desktop.

Interactive GUI Use

MATLAB is extremely resource-intensive and should not be run on the head node. The use of an interactive batch session is required. The code below assumes the use of X11 forwarding. Other methods of enabling a gui display back to the desktop are available.

$ srun --export ALL --pty --x11 -p norm bash
$ module load matlab
[+] Loading matlab R2024a
$ matlab

As MATLAB is so resource-intensive, the initial startup will take a few minutes. Eventually, the MATLAB banner will be displayed, followed by the execution window.

Image
MATLAB Banner
Image
MATLAB execution window

Interactive CLI Use

MATLAB is extremely resource-intensive and should not be run on the head node. The use of an interactive batch session is required. The code below assumes the use of X11 forwarding. Other methods of enabling a gui display back to the desktop are available.

$ srun --export ALL --pty -p norm bash
$ module load matlab
[+] Loading matlab R2024a
$ matlab
                                           < M A T L A B (R) >
                                 Copyright 1984-2024 The MathWorks, Inc.
                            R2024a Update 4 (24.1.0.2628055) 64-bit (glnxa64)
                                              May 29, 2024
 
To get started, type doc.
For product information, visit www.mathworks.com.
 
>> 

MATLAB will start much more quickly through the CLI than when a GUI is requested. MATLAB scripts can be executed directly through the CLI.

#!/bin/bash
#SBATCH --job-name=matlab
#SBATCH --time=1:00:00
#SBATCH --partition=norm
#SBATCH --ntasks=1
#SBATCH --mem=16GB
module load matlab
[+] Loading matlab R2024a
cat hello.R   # look at the contents of the script
cat('Hello World!')
matlab -nosplash -nodisplay -batch hello