#!/bin/bash
#SBATCH -J Matlab-ParamJob
#SBATCH -a 1-4

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

#### RUN MATLAB JOB ####
echo "Starting Matlab"
matlab -nodisplay << EOF &>> matlab.out

MyParameter = $SLURM_ARRAY_TASK_ID
disp("Execute function with parameter: " + MyParameter)

myfact(MyParameter)
save('myworkspace')

exit
EOF
