title: How to run two MATLAB instances simultaneously with different pathdef's?
body: <p>I'm developing my own brain imaging toolbox that runs under MATLAB &amp; SPM8, and at the same time I have a <code>git clone</code>'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 <a href="https://stackoverflow.com/questions/10665752/how-to-work-simultaneously-on-several-different-versions-of-files-with-git">How to work simultaneously on several different versions of files with git?</a>, which solved a part of the problem (how to have different versions of same <code>.m</code> file accessible at the same time, and still synchronizable by using <code>git fetch</code> or <code>git pull</code>).</p>
  
  <p>However, my MATLAB install is in neither of these git directories; it's installed normally in <code>/usr/local/MATLAB/R2012a/</code>. MATLAB looks for functions according to <code>pathdef.m</code>, which is stored in <code>which pathdef</code> (<code>/usr/local/MATLAB/R2012a/toolbox/local/pathdef.m</code>) as a regular function. So I cannot have two MATLAB instances running simultaneously so that they had different <code>pathdef</code>'s, at least not by modifying <code>pathdef.m</code> file.</p>
  
  <p>Of course MATLAB has to know beforehand where to look for <code>pathdef.m</code> to define the path. Is there a way to change <code>pathdef.m</code> 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 <code>pathdef</code>'s? Or should I install MATLAB in two different directories? I'm interested in all kinds of solutions for this problem.</p>