Matlab Installation (or Upgrade)

The Matlab Package Manager (mpm) can be used to install Matlab on a NUC via the command line. An exemplary bash script to remove current versions and install a new one follows.

#!/bin/bash

cd /tmp

# remove installed versions if present
rm -rf /usr/local/MATLAB/R2020a/
rm -rf /usr/local/MATLAB/R2022a/
rm -rf /opt/MATLAB/R2020a/
rm -rf /opt/MATLAB

# get mpm
wget -q https://www.mathworks.com/mpm/glnxa64/mpm
chmod +x mpm

# install release and toolboxes
MATLAB_RELEASE=r2023a
TOOLBOXES="Parallel_Computing_Toolbox ROS_Toolbox Statistics_and_Machine_Learning_Toolbox Symbolic_Math_Toolbox"
./mpm install --release=$MATLAB_RELEASE --destination=/usr/local/MATLAB/R2023a/ --products MATLAB $TOOLBOXES

# symbolic link
ln -sf /usr/local/MATLAB/R2023a/bin/matlab /usr/local/bin/matlabR2023a

# remove mpm
rm -f mpm /tmp/mathworks_root.log

Network Setup

Matlab is set up on the NUCs using a network license using this guide. We currently use the Matlab 2023a version.

If an existing installation with license is present on a NUC, simply copying the licenses folder in the installation directory (e.g. /usr/local/MATLAB/R2023a/licenses) to the new installation folder suffices.

DDS Setup

You can find all information required to set up RTI DDS in Matlab here: https://www.mathworks.com/hardware-support/rti-dds.html.

A backup copy can be found in sciebo/CPM/Project/Lab/08_Other/MatlabRtiDdsBackup.

To use RTI DDS Support, you must have RTI DDS installed on your system.

Important Environment Variables

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
    /home/controller/...: //Library files of cpm lib (libcpm.so) and middleware (libadditional_idl.so)
    /opt/rti_connext_dds-6.0.0/lib/x64Linux4gcc7.3.0
PATH=$PATH:
    $HOME/bin:
    $HOME/.local/bin:
    /opt/rti_connext_dds-6.0.0:
    /opt/rti_connext_dds-6.0.0/bin:
    /opt/rti_connext_dds-6.0.0/lib/x64Linux4gcc7.3.0:
    /opt/rti_connext_dds-6.0.0/bin:
    /opt/raspbian-toolchain-gcc-4.7.2-linux64/bin
NDDSHOME=/opt/rti_connext_dds-6.0.0
RTI_LICENSE_FILE=/opt/rti_connext_dds-6.0.0/rti_license.dat

Your installation paths might be different, so you might need to change some of them.