Search code examples
matlabselectstartupversions

How to select which Matlab version to start from shell or Matlab startup?


I have multiple Matlab versions installed on my PC. To say, R2006b, R2009b, R2010a. In this particular application I want to start R2009b when I start it from Shell. Is there any options at the time of startup to select which version to run?


Solution

  • To find which Matlab is started by default, type path in the shell (opened by Run->cmd). The first one is the one that is picked if you type Matlab.

    From the output of path you also find where your Matlab versions are located. If you don't want to navigate to the respective folder every time, you can make console aliases for the different versions.

    EDIT

    If you want to solve the problem in a very general sense, I see two possible avenues:

    (1) Check the registry for whether Matlab puts something version-specific there that is tied to the path (or ask TheMathWorks).

    (2) Parse path for '\bin\64' (or '\bin\32' if it's a 32-bit system) and check whether these folders contain a file called 'matlab'. As part of the installation routine (if the Matlab versions are not in the factory-default locations), start each Matlab, and run ver to find which version it is.