Works great, thank you! 2016-09-05 8:53 GMT+02:00 Anderson M. Winkler <[log in to unmask]>: > Hi David, > > You'd break in a per-space basis, i.e.: > > > *palm('-i','data/4D_1.nii','-m','data/mask_1.nii','-d','data/designmatrix_1.csv','-data/contrasts_1.csv','-n',10000,'-T','-corrcon','-o','data');* > > > Another possibility that is useful when just a few options change for each > iteration is to define a fixed variable with the options that don't change, > e.g., > > *palmopts = > {'-i','data/4D_1.nii','-m','data/mask_1.nii','-d','data/designmatrix_1.csv','-data/contrasts_1.csv','-n',10000,'-T','-corrcon'};* > > > Then add other options: > > *palm(palmopts{:},'-o','results');* > > > Hope this helps. > > All the best, > > Anderson > > > On 4 September 2016 at 15:12, David Hofmann <[log in to unmask]> > wrote: > >> Hi all, >> >> I want to use PALM for analysing several (hundred) data sets, thus I need >> to somehow automatise it and use it in a loop. I tried to use PALM in >> Matlab with the function syntax instead of the command syntax so I can loop >> through the different nifti files, masks etc. But I'm having difficulties >> making this work. >> >> Command syntax for first 4D file works: >> >> palm -i data/4D_1.nii... >>> -m data/mask_1.nii... >>> -d data/designmatrix_1.csv -t data/contrasts_1.csv -n 10000 -T... >>> -corrcon -o data >> >> >> but it is not possible to replace the commands/filenames by variables. >> >> I tried the following function syntax: >> >> >>> palm('-i data/4D_1.nii',' -m data/mask_1.nii','-d >>> data/designmatrix_1.csv','-data/contrasts_1.csv',... >>> '-n 10000','-T','-corrcon','-o data'); >> >> >> But I get the following error message: >> >> Error using palm_takeargs (line 1133) >>> Unknown option: "data/4D_1.nii" >>> Error in palm_core (line 33) >>> [opts,plm] = palm_takeargs(varargin{:}); >>> Error in palm (line 81) >>> palm_core(varargin{:}); >> >> >> Any help appreciated! >> >> greetings >> >> David >> >> >> >> >> >