Hello Kiyotaka, absolutely, feel free to use or modify it at your leisure! It really is only elegant insofar as I at some point stumbled across the spm_rmpath function, which does all the complicated work... Cheers, Marko Kiyotaka Nemoto wrote: > Dear Marko, > > I noticed that you already answered Rebecca's question after I sent the message. > Thank you for sharing your script. Yours is more elegan than my solution. > I would like to employ it. > > Best regards, > > Kiyotaka > > > > 2014-12-17 23:43 GMT+09:00 Marko Wilke <[log in to unmask]>: >> Hello Rebecca, >> >> having recently exposed my stupidity by including spm8 functions in the path >> and then complaining about spm12 not running I can relate to your problems >> ;) I have scribbled together a little function that you can use to switch >> between spm versions on your machine. If you copy (and adapt) that to an >> m-file of your liking, this should help you to avoid conflicts. Type the >> name of the function once spm has started in order to switch over to the >> other installation. >> >> % === start === >> >> % get current spm directory >> d = spm('Dir'); >> >> >> % get current version >> ver = spm('ver'); >> >> >> % find "other" version >> if ~isempty(strfind(ver, '8')) >> >> other = 'PATH-TO-YOUR-SPM12-INSTALLATION'; >> >> else >> >> other = 'PATH-TO-YOUR-SPM8-INSTALLATION'; >> >> end; >> >> >> % remove current version's path >> spm('Quit'); >> evalc('spm_rmpath;'); >> >> >> % add other version's path >> addpath(other); >> >> >> % clear >> clear classes >> >> >> % and call >> spm('fmri'); >> >> >> % that's it >> return; >> >> >> % === end === >> >> Not very elegant, but it seems to work for me. >> >> Cheers, >> Marko >> >> >> >> Rebecca Charlton wrote: >>> >>> I'm aware this is probably a very simple question, but I'm not super >>> knowledgeable about these things and could use some help. >>> >>> We have recently installed spm12 (as well as spm8) onto windows machines. >>> The most recenlty loaded version runs okay but we are struggling to run the >>> older version. Is there a preferred way of organising the subfolders in >>> MATLAB to make this work? Is there a way to navigate to the correct folder >>> in matlab and then launch spm from there? We have centrally adminstered pcs >>> which adds some difficulty with changing the path. >>> >>> At first navigating to the correct folder and typing spm seemed to work, >>> but actually the bach editor window doesn't open properly. My impression is >>> that information is being pulled from more than one verison of spm and that >>> this is causing problems. >>> >>> Any advise, greatfully received. Many thanks >>> >>> Merry Chrismas >>> Rebecca >>> >>> Dr. Rebecca Charlton >>> Lecturer in Psychology; Undergraduate Admissions Tutor >>> Department of Psychology >>> Goldsmiths, University of London >>> New Cross >>> London, SE14 6NW >>> UK >>> >>> Tel: + 44 (0)20 7919 7222 >>> Email: [log in to unmask] >>> >> >> -- >> ____________________________________________________ >> PD Dr. med. Marko Wilke >> Facharzt für Kinder- und Jugendmedizin >> Leiter, Experimentelle Pädiatrische Neurobildgebung >> Universitäts-Kinderklinik >> Abt. III (Neuropädiatrie) >> >> Marko Wilke, MD, PhD >> Pediatrician >> Head, Experimental Pediatric Neuroimaging >> University Children's Hospital >> Dept. III (Pediatric Neurology) >> >> Hoppe-Seyler-Str. 1 >> D - 72076 Tübingen, Germany >> Tel. +49 7071 29-83416 >> Fax +49 7071 29-5473 >> [log in to unmask] >> >> http://www.medizin.uni-tuebingen.de/kinder/epn/ >> ____________________________________________________ >> > > > -- ____________________________________________________ PD Dr. med. Marko Wilke Facharzt für Kinder- und Jugendmedizin Leiter, Experimentelle Pädiatrische Neurobildgebung Universitäts-Kinderklinik Abt. III (Neuropädiatrie) Marko Wilke, MD, PhD Pediatrician Head, Experimental Pediatric Neuroimaging University Children's Hospital Dept. III (Pediatric Neurology) Hoppe-Seyler-Str. 1 D - 72076 Tübingen, Germany Tel. +49 7071 29-83416 Fax +49 7071 29-5473 [log in to unmask] http://www.medizin.uni-tuebingen.de/kinder/epn/ ____________________________________________________