How do I run a Matlab script on Odyssey?

To run a Matlab script (with no graphical interface component) on the Odyssey cluster, login using your preferred terminal application then activate the application by loading the module (Note: There are several versions available).

example: module load matlab/R2016b-fasrc01

Then, assuming your script is named calc.m, either run it through an interactive session

srun --pty --mem 1000 -p interact matlab -nojvm -nodisplay -nosplash < calc.m

or use the matlab command in a batch script

#SBATCH -o calc.out
#SBATCH -o calc.err
#SBATCH -p serial_requeue
#SBATCH -n 1
#SBATCH --mem 1000
#SBATCH -t 1000

matlab -nojvm -nodisplay -nosplash < calc.m

Make sure that `calc.m` finishes with an `exit` command. Otherwise, the process will hang waiting for further input.

Posted in: d. Software

CC BY-NC 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. Permissions beyond the scope of this license may be available at Attribution.