I'm trying to run a matlab script (ga_opt_main.m) in a cluster. I have to write a job submission file, which is essentially just a shell script. But I have never written a shell script and this is what I wrote
#!/bin/bash
#PBS -q *queuename*
#PBS -l nodes=1:ppn=20
#PBS -l walltime=02:00:00
#PBS -N ga_opt_main
module load matlab/R2011b
module list
unset DISPLAY
matlab -nodisplay -nodesktop -r *directory path/ga_opt_main.m*
MATLAB opens in the background but my job is not run. Instead I get an error file saying
bash: -c: line 0: syntax error in conditional expression
bash: -c: line 0: syntax error near `fraction'
Any ideas on why this occurs and how it can be avoided? Thanks!
#PBS -q *queuename*looks a little fishy....-r "..."must be correct commands as you would type them in MATLAB command window in the IDE. To run a script, you either browse to the same directory as the file or you add its folder to thepath, then call it by name (or use the RUN function as I've showed).*directory path/ga_opt_main.m*with a Matlab command, as Amro stated.