Why does MATLAB launch with the wrong version on Linux?

I have multiple versions of MATLAB installed, but when entering the command matlab in terminal to start the application, the wrong version launches. How do I launch the correct version?

 Accepted Answer

This may occur due to a symbolic link to a different version when running the command matlab in terminal. MATLAB can be launched both with symbolic links or through the installation directory. 

Symbolic link

To check if there is a symbolic link, enter the command:
ls -l /usr/local/bin
If matlab is present in this directory, it will also include the path to the version it is linked to. 
To use multiple versions of MATLAB, you can create a symbolic link to each. For example, if the symbolic link matlab is pointing to R2024b, you can rename the symbolic link to something like "matlab24b" by entering this command:
mv /usr/local/bin/matlab /usr/local/bin/matlab24b
Then, create a new symbolic link to a different version such as R2024a by entering the command:
sudo ln -s /usr/local/MATLAB/R2024a/bin/matlab /usr/local/bin/matlab24a
The result will allow you to enter matlab24b in terminal to launch MATLAB R2024b and matlab24a to launch MATLAB R2024a.
Note: this will work for any version of MATLAB and you may name the symbolic links as you'd like to help with differentiating between the different releases.

Installation directory

To launch MATLAB from the installation directory, you will need to make sure you are in the directory for the correct release.
Open the terminal and navigate to MATLAB Installation directory for your release
cd /usr/local/MATLAB/R20XXy/bin
You can then start MATLAB:
./matlab

More Answers (0)

Categories

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!