Jump to content

MATLAB

From RHLUG Wiki

Compatiblility[edit | edit source]

MATLAB R2025b officially supports these distros, or distros using these bases:

  • Ubuntu 24.04 LTS
  • Ubuntu 22.04 LTS
  • Debian 13
  • Debian 12
  • Red Hat Enterprise Linux 9 (minimum 9.2)
  • Red Hat Enterprise Linux 8 (minimum 8.6)
  • SUSE Linux Enterprise Desktop 15 (minimum SP4)
  • SUSE Linux Enterprise Server 15 (minimum SP4)

Though technically not officially listed, these distros have been found to work as well:

  • Fedora Linux 43 (based on RHEL support)

These distros you're probably gonna have some trouble installing:

  • Arch Linux
  • NixOS
  • Gentoo

Installation Guide (All Distros)[edit | edit source]

1. Launching the Installer[edit | edit source]

You will need a Mathworks account with a registered MATLAB license. This can be obtained by downloading and launching MATLAB through software center.

1. Go to https://www.mathworks.com/downloads/web_downloads/ and sign in if needed

2. Click on "Download for Linux"

3. In your downloads file, move the zip file to another folder, such as "matlab_installer" and then in the folder run unzip matlab_RYYYYx_Linux.zip where YYYY is the year and x is a or b, depending on the release

4. cd into your installation folder, and then run sudo chmod +x ./install

5. Launch the installer with sudo ./install

2. Navigating the Installer[edit | edit source]

1. Log in with your Mathworks account

2. Proceed through the installation steps. It is recommended that you install MATLAB to a directory that is NOT in your home directory, that way MATLAB can access system-level files. The default installation directory is /usr/local/MATLAB/RYYYYx

3. Select all the toolboxes you need. It's better to install even ones you don't necessarily need now, as it is harder to install toolboxes later

3. Launching MATLAB[edit | edit source]

After installation, there are multiple post-installation steps you will need to follow in order to get MATLAB to work. First we need to create a .desktop file for your DE to recognize MATLAB as a program. 1. If you don't have it already, create the directory: mkdir ~/.local/share/applications/

2. Create the desktop file nano ~/.local/share/applications/matlab.desktop

3. Paste the following text:

[Desktop Entry]
Version=1.0
Type=Application
Name=MATLAB RYYYYx
Exec=%MATLAB_INSTALLATION%/matlab-launcher.sh
Icon=%MATLAB_INSTALLATION%/toolbox/shared/dastudio/resources/MatlabIcon.png
Categories=Development;Science;Math;
Terminal=false
StartupWMClass=MATLAB RYYYYx Update z

where:

  • YYYY is the MATLAB year release
  • x is the semi-year release variant (a or b)
  • %MATLAB_INSTALLATION% is the directory to your MATLAB folder (which is /usr/local/MATLAB/ by default)
  • z is the update variant, if there is one. (It will label as such on the MATLAB download page, if there is no update variant, then remove this)

We will create the matlab-launcher.sh file next.

4. Create the launcher file sudo nano /%MATLAB_INSTALLATION%/matlab-launcher.sh

5. Paste the following text:

#!/bin/bash
export GDK_BACKEND=x11 
export QT_QPA_PLATFORM=xcb 
/%MATLAB_INSTALLATION%/RYYYYx/bin/matlab -desktop "$@"

this forces MATLAB to use X11 in the background. You may need to install X11 dependencies in order for this to work

!!! MATLAB ARCH FIX INFORMATION !!!

Basically download gnutls 3.8.9-1 from archive and LD_LIBRARY_PATH it