Hi Jimbo,
I'm afraid I do not quite understand what you are trying to do. Anyway, your jobs.m should evaluate to a single batch job variable and there is no way to pass arguments to the evaluation step. If there remain '<UNDEFINED>' items (marked '<-X' in the GUI) in the evaluated job, spm_jobman will try to fill them with the remaining arguments passed to spm_jobman('run',...). Non-matching arguments (e.g. file names as character/string array instead of a cellstr) will be discarded, an your job will most likely fail to run.
If you want to use a job template multiple times, your loop should go into main.m. You can either call spm_jobman repeatedly or gather all information for all runs at once and repeat the jobs.m in jobfiles as often as needed.
Hope this helps,
Volkmar
|