#!/bin/bash #!/bin/bash fun_name="z_eegmp_old_new_ERP" job_name="eegmp_test" rootpath="$(pwd)/.." rootpath=$(builtin cd $rootpath; pwd) mkdir ${rootpath}/log for subj in $(seq 1 33); do cursub=$(printf "sub-%03d\n" ${subj}) echo ${cursub} # if not been performed yet #if [ ! -f ${rootpath}/data/erf/sub-$(printf "%03d" ${subj})*_erf.mat ]; then sbatch \ --job-name ${job_name}_${cursub} \ --cpus-per-task 4 \ --mem 6gb \ --time 00:30:00 \ --output ${rootpath}/log/${job_name}_${cursub}.out \ --workdir . \ --wrap=". /etc/profile ; module load matlab/R2016b; matlab -nodisplay -r \"${fun_name}('${rootpath}','${cursub}')\"" #fi done