Matlab_PBS

#!/bin/sh

#PBS -N matlab_model

#PBS -q queue_name

# Send the mail messages from the server to a user address 
# This line and the Technion address are mandatory!
#--------------------------------------------------------
#PBS -M user@technion.ac.il

#PBS -mbea
#
# running built-in MATLAB multithreading option on N cores of an available node 
#-------------------------------------------------------------------------------
#PBS -l select=1:ncpus=N


PBS_O_WORKDIR=$HOME/my_matlab_dir
cd $PBS_O_WORKDIR

#MATLAB run command
#-----------------------
matlab -nodesktop < matlab_script.m > output

#comment on parallel MATLAB usage
#--------------------------------------
# If you wish to use additional parallel options, please introduce relevant
# commands into your matlab code - for example (the syntax is not exact!)
#-------------------------------------------------------------------------
# matlabpool open local N
# parfor: begin - end
# matlabpool close
#---------------------------------------------------------------------------
# and run the same batch script