Dear all,
SPM does initialise many things during its normal startup, including paths, modality specific default values, batch system etc. Saving the full matlabpath in a pathdef.m file could cause many problems and should be avoided. Instead, the command
addpath(PATH_TO_SPM)
can be used in a startup.m file. Note that only the top level folder of your SPM distribution needs to be added (no genpath etc).
Even if running SPM from a script without user interaction, I would recommend to run
spm fmri % or whatever modality you use (eeg, pet)
prior to any script code. If you don't want graphics output to appear on your screen, start MATLAB with the -nodisplay option. This does not open any GUI windows, but SPM and your code will still be able to do most of the graphics output.
Best,
Volkmar
|