I'm developing my own brain imaging toolbox that runs under MATLAB & SPM8, and at the same time I have a git clone
'd version of my own toolbox code directory (local git repository) for running analyses, this setup is created according to Kevin Reid's answer on How to work simultaneously on several different versions of files with git?, which solved a part of the problem (how to have different versions of same .m
file accessible at the same time, and still synchronizable by using git fetch
or git pull
).
However, my MATLAB install is in neither of these git directories; it's installed normally in /usr/local/MATLAB/R2012a/
. MATLAB looks for functions according to pathdef.m
, which is stored in which pathdef
(/usr/local/MATLAB/R2012a/toolbox/local/pathdef.m
) as a regular function. So I cannot have two MATLAB instances running simultaneously so that they had different pathdef
's, at least not by modifying pathdef.m
file.
Of course MATLAB has to know beforehand where to look for pathdef.m
to define the path. Is there a way to change pathdef.m
lookup path eg. by some MATLAB command line argument or from MATLAB console? Or by some other means, so that I could have two MATLAB instances running simultaneously with different pathdef
's? Or should I install MATLAB in two different directories? I'm interested in all kinds of solutions for this problem.