I also have scripts like this for all SPMs (99, SPM2, SPM5, SPM8).
Didn't know the existence of spm_rmpath so it has some lines more.
Nevertheless the one from Kiyotaka seems more elegant.
Mine looks like this:
#######################
if (size(regexp(path, 'spm2'),1) > 0)
rmpath(genpath('C:\MATLAB\R2006b\work\spm2')); disp('Removed
SPM2...'); end;
if (size(regexp(path, 'spm99'),1) > 0)
rmpath(genpath('C:\MATLAB\R2006b\work\spm99')); disp('Removed
SPM99...'); end;
if (size(regexp(path, 'spm8'),1) > 0)
rmpath(genpath('C:\MATLAB\R2006b\work\spm8')); disp('Removed
SPM8...'); end;
addpath(genpath('C:\MATLAB\R2006b\work\spm5'));
disp('Added new SPM...');
savepath;
disp('Path saved. This will be the default SPM when Matlab starts');
######################
2009/5/6 Kiyotaka Nemoto <[log in to unmask]>:
> Dear Andra and Gillaume,
>
> I once wrote a tiny script which enables running different versions of
> spm concurrently.
> With the hint by Guillaume, I revised the script a little bit.
>
> Save the following two scripts as spm8.m and spm5.m in some directory
> (e.g. My Documents\MATLAB\), and you will be able to run spm5 and spm8
> concurrently by typing "spm8" or "spm5".
>
>
>
> %%%%%%%%%%%%%%% spm8.m
> % try to close spm, remove other spm path and clear variables
> try
> spm quit;
> clear all;
> spm_rmpath;
> end
> addpath c:\spm\spm8\;
> spm;
>
>
>
>
> %%%%%%%%%%%%%%% spm5.m
> % try to close spm, remove other spm path and clear variables
> try
> spm quit;
> clear all;
> spm_rmpath;
> end
> addpath c:\spm\spm5\;
> spm;
>
>
>
>
> Guillaume, we can also apply this script to spm2 if I put the
> spm_rmpath.m file into spm2 folder. Is it coorect?
>
>
> Hope this helps,
>
> Kiyotaka
>
>
> 2009/5/6 Andra Smith <[log in to unmask]>:
>> Is it possible to run both versions of SPM on the same computer?
>> Thanks.
>>
>>
>> __________________________________________________________________
>> The new Internet ExplorerŽ 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
>>
>
>
>
> --
> Kiyotaka Nemoto, M.D.
> Department of Psychiatry
> Graduate School of Comprehensive Human Sciences
> University of Tsukuba
> 1-1-1Tennodai Tsukuba, Ibaraki 305-8575, Japan
> E-mail: [log in to unmask]
>
|