How to submit non-interactive MATLAB scripts to the queues
Wherever possible DO NOT run full MATLAB directly on the cluster, instead compile your code (see the MATLAB page) but where this is not possible or you only need to run a quick single job task it is acceptable to run the full MATLAB environment on the cluster.
Any non-interactive MATLAB task needs to be submitted by creating a file (typically with the extension '.m'), eg 'myfile.m' with all your MATLAB commands in and submit it using 'fsl_sub'; once the task is running you can look at the file "matlab.o<jobid>" for any output.
fsl_sub -q short.q matlab -singleCompThread -nodisplay -nosplash \< mytask.m
NB The "\" is very important since MATLAB won't read your script otherwise.
Warning: MATLAB tasks will often attempt to carry out some operations using multiple threads. Our cluster is configured to run only single thread programs, so if multiple threads are used you can overload it. The ''-singleCompThread'' option disables this multi-threading.
Although many built-in functions in MATLAB are multi-threaded the cluster is configured to prevent any task running threads on more than one CPU unless run within a parallel environment.
Request a parallel environment and ensure that your MATLAB script includes the lines:
NSLOT_VAR = getenv('FSLSUB_NSLOTS')
N = getenv(NSLOT_VAR)
LASTN = maxNumCompThreads(N)