When you see an error in Matlab referring to an "Undefined function",  it often means that Matlab cannot find the function.   This means that your Matlab paths are setup incorrectly.

For example when using spm8 this is my path.

/spm8_2013a/matlabbatch/cfg_basicio
/spm8_2013a/toolbox/Shoot
/spm8_2013a/toolbox/DARTEL
/spm8_2013a/toolbox/Seg
/spm8_2013a/toolbox/FieldMap
/spm8_2013a/config
/spm8_2013a/matlabbatch
/spm8_2013a

Of course everyone configuration will be a little different.

I suspect your path is missing spm8/matlabbatch.

Dennis
 


On Wed, Jul 9, 2014 at 2:48 PM, Katie Surrence <[log in to unmask]> wrote:
Dear SPM experts,

I am new to batch programming.  I am trying to write a short batch script to segment and skullstrip my data and I am getting an error:

______________________

Undefined function 'list' for input arguments of type 'cell'.

Error in cfg_repeat/list (line 112)
            [id1 stop1] = list(citems{k}, spec, tropts);

Error in cfg_util>local_getcjid2subs (line 1196)
cjid2subsin = list(cjin, exspec, tropts);

Error in cfg_util>local_initjob (line 1367)
[ucj ucjid2subs] = cellfun(@local_getcjid2subs, ucj, 'UniformOutput',
false);

Error in cfg_util (line 678)
            [jobs(cjob) mod_job_idlist] = local_initjob(jobs(cjob),
            job, jobdedup);

Error in spm_jobman (line 216)
        cjob = cfg_util('initjob', mljob);

Error in ks_seg_and_strip (line 77)
    output = spm_jobman('run',matlabbatch);

_________________________

I am attaching my full script. 

I found this discussion of the same error:

https://www.jiscmail.ac.uk/cgi-bin/webadmin?A3=ind1305&L=SPM&E=quoted-printable&P=1000032&B=--Apple-Mail%3D_CC849512-9CAA-4FB8-86B8-B8A0FCE8F1F3&T=text%2Fhtml;%20charset=iso-8859-1&pending=

https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=spm;2620fbcc.1305

but I didn't quite understand what the solution was.  I did try moving my SPM installation in case it would help, but it didn't.  I have another batch script to run just realignment that works without issue, and it's set up very similarly. 

I'm having trouble wrapping my mind around the fact that it's a path issue but the error reports quote from inside the function that it says is undefined. 

I would appreciate any insight you can provide.

Best,
Katie