Skip to content

How to run MATLAB on ScienceCloud

This guide provides instructions for users to easily run MATLAB on the ScienceCloud.

Step-by-Step Instructions

Create an Instance (one-time step)

Start by creating an instance using one of the latest images that includes Singularity. Ensure to select an image with the *** prefix in its name, such as ***Singularity on Ubuntu 20.04 (2023-11-06).

After creating the instance, install the latest updates and reboot the system:

   sudo apt update
   sudo apt full-upgrade
   sudo reboot

Load MATLAB Module

Load the most recent MATLAB module using the following command:

module load matlab

Note

When you load a MATLAB module for the first time, the container will be downloaded to your instance. Due to MATLAB's size, this process may take approximately 15-20 minutes to complete. Please note that there won't be a progress bar during this process. Once installed, subsequent loading of the module will take less than a second.

Specific MATLAB Versions

If you need a specific version of MATLAB, list available modules:

module av

From the list of available modules, load a specific version:

module load matlab/r2023a

Note

Loading multiple versions of MATLAB modules on a single instance may exhaust disk space due to their significant storage requirements.

Run MATLAB

Once the MATLAB module is loaded, you can run MATLAB commands as usual. Test MATLAB with a command like:

matlab -nodisplay -r 'disp(magic(5)*magic(5)); exit'

Hints and Suggestions

GUI Usage

To run MATLAB with a GUI, enable X forwarding when connecting to the instance via SSH:

ssh -XY ubuntu@<ip-address>

GPU Usage

If your instance has a GPU and was created from an image with CUDA drivers, load the GPU module along with MATLAB for GPU-accelerated computations:

module load gpu matlab

Error Handling

If you encounter the "Unrecognized function or variable 'Settings'" error, run settings in MATLAB to initialize settings properly.