How to run MATLAB on ScienceCloud¶
-
Create an instance using one of the latest Singularity images. The latest images have
***
prefix in their names. For instance, you could use***Singularity on Ubuntu 20.04 (2023-11-06)
. -
Install the latest updates and reboot
sudo apt update
sudo apt full-upgrade
sudo reboot
-
List available modules with
module av
-
Select the version you would like to run and load it with
module load matlab/r2023a
The first time you load the module, the MATLAB container will be downloaded to your instance. Since MATLAB is quite large, it may take 15-20 minutes to complete. You will see no progress bar. Subsequently, the module will be loaded in less than a second. -
Once the module is loaded, you can run MATLAB as you normally would. For example, you can test it with the following command.
matlab -r 'disp(magic(5)*magic(5)); exit'
Hints and suggestions¶
-
To run MATLAB with GUI, you would need to enable X forwarding while connecting to the instance. When using command line, this can be done by adding
-X
flag to yourssh
command. -
If you created an instance with a GPU, you might be able to use it with MATLAB if you also load the
gpu
module, e.g.
module load gpu matlab/r2021b
-
If you encounter the error: "Error using exit. Unrecognized function or variable 'Settings'.", run
settings
in MATLAB. That will properly initialise the settings and the error should disappear. -
While it is possible to run several MATLAB versions on a single instance, you will run out of space very quickly due to their disk space requirements.