#!/bin/csh # this script is a qsub companion script to handle single-core # MATLAB batch job. Define multiple parameters with -v option. # Usage examples: # scc1$ qsub ./run_matlab_job # n=4 (default) # scc1$ qsub -v n=6 ./run_matlab_job # n=6 (set/override) # # Specify SGE batch scheduler options # Merge output and error files in one #$ -j y # Send email to SCC userID when job finished or aborted #$ -m ae # Give the job a name #$ -N myJobs #$ -v n=4 #$ -v a=123.45 #$ -v str='Hello World!' matlab -nodisplay -singleCompThread -r \ "str='$str'; fprintf('%7.2f; %s\n',$a,str), rand($n), exit"