views:

140

answers:

3

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?

+1  A: 

Don't you simply specify the absolute path to the location of the version you want to run ?

High Performance Mark
Thanks for your comment. The problem here is that, I want start Matlab from other program and for that I am using shell. I dont know the absolute location of the particular version i.e. R2009b
Nitin Kale
+1  A: 

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.

Jonas
Thanks Jonas for your reply.path command returns folder path of the matlab installations. But there is no way to judge where the particular version resides by just analyzing folder path. Usually, matlab versions are stored in 'R2006b', 'R2009b' etc folders but these are just the names of the folder. User can change the folder name, and we cannot get the correct path.
Nitin Kale
Ok, I see your problem now. I don't think there is an easy fix, but I can give you two suggestions
Jonas
Thanks again Jonas. Right now I am looking at way (1), to check the registry path. I have come to the conclusion that Mathworks stores the matlab in the MyComputer->HKEY_LOCAL_MACHINE->SOFTWARE->MATHWORKS-MATLAB loactionAgain it has following folder for each version.7.3 : for R2006b7.9 : for R2009b7.10: for R2010aI can check if '7.9' exist if yes, can read 'MATLABROOT' entry which gives the fullpath of installation.I need to try this if it can really works.
Nitin Kale
I think it should, since matlabroot is a very important parameter.
Jonas
The registry method worked, and gave me the desired location of the Matlab R2009b exe.Thanks for all the help.
Nitin Kale

related questions