I have a SLURM job script as follows:
#!/bin/bash
#SBATCH -o ./out/%x.%j.%N.out
#SBATCH -e ./out/%x.%j.%N.err
#SBATCH -D ./
#SBATCH -J matlab_serial_batch_job
#SBATCH --nodes=1
#SBATCH --tasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --time=0:30:00
module load slurm_setup
module load matlab/R2021a-generic
NROWA=1000
NCOLA=2000
NROWB=2000
NCOLB=5000
MYSTRING='blablabla'
# Run MATLAB
matlab -nodisplay -singleCompThread \
-r "matmul_serial([$NROWA $NCOLA], [$NROWB $NCOLB], $MYSTRING);"
As you might see, I would like to set and pass a string variable called MYSTRING to the MATLAB function matmul_serial. However, I got the following error:
Unrecognized function or variable 'blablabla'
For those integer variables NROWA, NROWB, NCOLA and NCOLB, they work pretty fine. How do I properly set and pass the string variable MYSTRING in this context?