% List of open inputs nrun = X; % enter the number of runs here jobfile = {'/Volumes/MacintoshHD2/David_MasterThesis_July2016/spectralDCM/test/BMS_ex1_job.m'}; jobs = repmat(jobfile, 1, nrun); inputs = cell(0, nrun); for crun = 1:nrun end spm('defaults', 'FMRI'); spm_jobman('run', jobs, inputs{:});