module () { eval `/usr/bin/modulecmd sh $*` } #!/bin/sh -xv echo "Hello Matlab!" + echo 'Hello Matlab!' #copy data to temporay directory #jobdir=`pwd` #cp -r * $TMPDIR/ #cd $TMPDIR #set execution permissions for the matlab script and executable chmod u+x run_FGI_AA.sh + chmod u+x run_FGI_AA.sh chmod u+x FGI_AA + chmod u+x FGI_AA ls -l + ls -l ./run_FGI_AA.sh $MCRROOT/R2015a/v85 > matlabresults.txt + ./run_FGI_AA.sh /cvmfs/fgi.csc.fi/apps/sl6/matlab/R2015a/v85/R2015a/v85 Attempted to access Graph(499501,1); index out of bounds because size(Graph)=[499500,1]. Error in FGI_AA (line 83) MATLAB:badsubscript exitcode=$? + exitcode=255 #Copy results from the temporary directory #back to the home directory of the grid job #mv matlabresults.txt $jobdir/ #tar zcvf results.tgz ./* echo "Bye Matlab!" + echo 'Bye Matlab!' exit $exitcode + exit 255