Dear SPM community:
In my quest for an SPM batch file, I have edited " spm_fmri_spm_ui.m " so that it saves the arguments that go into the call to spm_spm.m . i.e:
% save variables into spm_vars.mat
% (I also saved Ufp, because spm_spm() uses it as a global variable)
%------------------------------------------------------------------------
global UFp
save spm_vars V H C B G CONTRAST ORIGIN GX HCBGnames P SIGMA RT UFp
% implement analysis proper
%--------------------------------------------------------------------------
spm_spm(V,H,C,B,G,CONTRAST,ORIGIN,GX,HCBGnames,P,SIGMA,RT);
%----------------------------------------------------------------------------------
Then I run spm in the same way that I normally would so that I can record the variables used. (the idea is akin to recording a macros and run them in batch files). After I'm finished, I quit SPM and make the calls
>> load spm_vars
>> spm_spm(V,H,C,B,G,CONTRAST,ORIGIN,GX,HCBGnames,P,SIGMA,RT)
to repeat the same Statistics analysis from a command prompt, but I get this error:
??? Index exceeds matrix dimensions.
Error in ==> /apps/matlab4/toolbox/matlab/elmat/meshgrid.m On line 38 ==> yy = yy(:,ones(1, nx));
Error in ==> /usr/local/src/matlab/spm96/spm_invFcdf.m On line 49 ==> df = meshgrid(df,1:prod(size(p)))';
Error in ==> /usr/local/src/matlab/spm96/spm_spm.m On line 166 ==> UF = spm_invFcdf(1 - UFp,Fdf)
I don't quite understand why this happens. Can anyone shed some light on this problem? Do I need to store other global variables as well?
Thanks in advance,
Luis>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|