#!/bin/bash #!/bin/bash fun_name="a_eegmp_calculate_erp_tfr" job_name="eegmp_erptfr" 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 8gb \ --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