#!/bin/sh -xv

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 FGI_AA

ls -l


./run_FGI_AA.sh $MCRROOT/R2015a/v85 > matlabresults.txt
exitcode=$?

#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!"
exit $exitcode
