There are 25 MATLAB concurrent licenses available on the SCC, that can be called from the compute nodes. MATLAB can be used graphically or as a command line interface, both accessible by logging into a compute node.

NOTE: MATLAB is not directly available on the management node. Computational demands, in particular RAM, required by MATLAB can interfere with other user's operations. MATLAB can only be called from a compute node, either directly (i.e. through login to that compute node) or through the queuing system. Both methods are outlined below.

Launching MATLAB

To launch a MATLAB as a graphical interface, log in to a dev node (with 'X' forwarding enabled) and call 'matlab'

user@scclogin01: ssh -X dev01
user@scclogin01: module load math/MATLAB/2020b
user@dev01: matlab

MATLAB and Modules

There are several modules that can be loaded into your environment for use specifically with MATLAB, for example, SPM and EEGLab. When 'module load' is called, environmental variables are set such that MATLAB can see the associated files within these modules. Therefore, to access SPM, EEGLab or additional modules for use with MATLAB, simply load them as a standard module.

Submitting Jobs to the Queue

For parallel computing, it is best to call 'matlab' from within a queue submission script without the graphical user interface (i.e. matlab - nodesktop -nojvm -nosplash) and direct your matlab script to the main program with "<" or with the '-r' flag.

cat submit_matlab.sh
#!/bin/bash -l
#SBATCH --job-name="SCC_MATLAB"
#SBATCH --output="SCC_MATLAB.out"
#SBATCH --error="SCC_MATLAB.err"
#SBATCH --mail-type=FAIL
#SBATCH --mail-type=BEGIN
#SBATCH --mail-type=END

##Job configuration
##Job resources
#SBATCH --ntasks=1
#SBATCH --tasks-per-node=8
#SBATCH --time=0-04:00:00
#SBATCH --mem=2gb


# Primary call to MATLAB. Run in non-graphical mode.
module load MATLAB
matlab -nodesktop -nojvm -nosplash < matlab-serial.m



cat matlab-serial.m
disp 'Testing Matlab on the SCC ...'

tic;
for ix = 1:12
pause(ix)

end
toc

disp ' ... Test Complete.'