#!/bin/bash
#SBATCH -J Matlab-Job
#SBATCH -p batch
#SBATCH -t 15:00

#### load module ####
module load matlab/R2021a

#### RUN MATLAB JOB ####
echo "Starting Matlab"
matlab -nodisplay << EOF &> matlab.out
a = 15;
disp(a)
disp("Calculating factorial:")
myfact(a)
disp("Calculating average:")
average
exit
EOF
