This is a simple tutorial to teach how to install MATLAB and properly activate it using the academic license from UFMG. It is based on the official tutorial from MathWorks, but it contains additional details regarding the installation on Linux which I have noticed to be missing on the original tutorial. Additionally, the information about the superuser seems to also be relevant for macOS users (needs confirmation). Nonetheless, the official tutorial, and the discussion topics that inspired this tutorial, are linked at the end of this page.
How to obtain the license
- Create a MathWorks account here using your institutional email (you will not get access to the license if you use your personal email);
- Link your account with the academic license of UFMG accessing here, selecting "Sign in to get started" and then using your MathWorks account previously created;
Download and installation
- On the page of the last step, select "Download installer", then choose the version you want to download and your operating system (which, in this tutorial, is assumed to be Linux);
- Extract the zip file, go to the extraction folder and run the installer
- sudo ./install
- Sign in with your MathWorks account and accept the "user agreement";
- Select the academic license from UFMG, that you just linked with your account on the last step of "How to obtain the license", and click "next";
- Select your Login Name. Here you have two options:
- Use your computer's user name. On the Terminal, run whoami and past the result on the installer. If you choose this option, you WILL NOT be able to initiate MATLAB as a superuser. On Linux (and possibly on macOS), this means you should not install MATLAB on the default path, as you will not have access to any of those folders (e.g., /usr/local/MATLAB/R2020a/) and any attempt of running MATLAB will result in several errors. I never tried to install MATLAB in an alternative folder and, therefore, do not know if this creates further problems (e.g., with software updates or toolboxes installation).
- Use the superuser as login name by typing "root". This will allow you to initiate MATLAB as a superuser and to use the default installation folders. (This is the option I have chosen and recommend.)
- Select the installation folder considering the previous discussion and click "next";
- Select the products you want to install and click "next". Selecting all the toolboxes will result in a considerable installation time;
- Select the desired options of software improvement and folder for symbolic links (again, remember the necessary permissions to access this folder) and click "next";
- Select "begin install".
- Go to the installation folder (here I am assuming the default)
- cd /usr/local/MATLAB/R2020a/bin
- Initiate MATLAB
- sudo ./matlab
To simplify this process, it is recommended to create an alias for the MATLAB. For instance, following this tutorial.
Licensing error: -9
This problem is caused by either a wrong Login Name (e.g, you are trying to run MATLAB as superuser, but registred it to your computer's name) or a wrong HOST ID name (there was some problem with your license registration). To solve this, we are going to deactivate your current license, reactivate it and (probably) perform an offline registration of MATLAB.
- Go to your MathWorks account here;
- Select your license number;
- Go to
- Install and Activate -> Activate to Retrieve License File
- Select your activated computer and then "Deactivate";
- Repeat the previous steps, but on the last one now select "Activate a computer";
- Select your release version;
- Select your operating system;
- Select your HOST ID. This should be your MAC address (if the interfaces are enumerated, use the lowest-enumerated interface). To get this address on Linux, open the Terminal and run
- ip addr | grep ether
- Select your Login Name. This should be the same you are using on your computer (i.e., computer's user name or superuser ID);
- Select an Activation Label. Any name is valid, this is purely to help you identify the computer you are registering;
- Click on "Continue".
- Download your license file by either clicking on the blue arrow or selecting your computer by name and clicking on "Get license file". Answer that you have already installed MATLAB on this computer and select "Download license file".
- Open a Terminal and run
- sudo /usr/local/MATLAB/R2020a/bin/activate_matlab.sh
- Select "Activate automatically using the internet" and follow the instructions;
- Try to run MATLAB;
- If the error persists, follow the next steps.
- Select "Activate manually without the Internet -> Enter the full path to your license file", then select the license you downloaded from your MathWorks account;
- Go to MATLAB's license folder (/usr/local/MATLAB/R2020a/licenses) and delete any other license files that are there besides the one you just added (the name of the one you downloaded is probably "license.lic");
- Run MATLAB.