MATLAB

Loading MATLAB

module load matlab/r2019a
matlab

Or for newer versions:

module load matlab/r2023a
matlab

Running MATLAB on the Cluster

Interactive (via Open OnDemand)

  1. Go to interactive.hpc.caltech.edu

  2. Select Interactive AppsMATLAB

  3. Choose resources and launch

Batch Jobs

#!/bin/bash
#SBATCH --job-name=matlab_job
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem=32G
#SBATCH --time=4:00:00

module load matlab/r2023a

matlab -nodisplay -nosplash -r "run('myscript.m'); exit"

Parallel Computing

For parallel MATLAB jobs using the Distributed Compute Engine, see:

Tips

  • Use -nodisplay for batch jobs

  • Use -nosplash to skip the splash screen

  • End scripts with exit to ensure MATLAB terminates

  • Request appropriate memory - MATLAB can be memory-intensive