Dear Feng,
your file list must be a cell array, where each array element (session) consists of a cellstr list of file names. It looks like you are creating a cellstr list of filenames instead. Instead of doing the cellstr() conversion yourself, you could replace the call to spm_select with a call to cfg_getfile. It has the same list syntax, but returns a cellstr list of filenames straight away. Your funFiles variable should then have the correct structure that is required to fill the batch template.
Hope this helps
Volkmar
|