> > I tried rerunning after commenting out the nargin >4 paragraph > in spm_spm.m (lines 1184-1187) and then the analysis completed, > ie wrote out the spm.mat file. I was then able to produce the contrast > images. > > %-Extra arguments were passed for saving in the SPM.mat file > %--------------------------------------------------------------- > % for i=5:nargin > % SPMvars = [SPMvars,{inputname(i)}]; > % eval([inputname(i),' = varargin{i-4};']) > % end > > I still need to address the root problem though since other analyses won't run > properly with my commenting out those lines in spm_spm.m > > Thanks for your help! > Andy > The problem is in using MATLAB function inputname(argnum). MATLAB help says: inputname(argnum) returns the workspace variable name corresponding to the argument number argnum. If the input argument has no name (for example, if it is an expression instead of a variable), the inputname command returns the empty string (''). In case when we estimate design using already existing SPMcfg.mat file, the call of spm_spm.m is done from within spm.m lines 613-627. In this case arguments are spm_spm(tmp.VY,tmp.xX,tmp.xM,tmp.F_iX0,tmp.Sess,tmp.xsDes) for fMRI and spm_spm(tmp.VY,tmp.xX,tmp.xM,tmp.F_iX0,tmp.xC,tmp.xsDes) for PET/SPECT in both cases inputname(4) and inputname(5) (lines 1185, 1186 in the spm_spm.m) returns empty string ('') instead of workspace variable name. Sergey Pakhomov