Skip to content


Matlab is available on the Linux machine by loading the matlab module.

module load matlab

Matlab non interactive

For matlab programs, the GUI is convenient while you develop your code but once it's working correctly, you need to run it as a batch to be allowed to use ressource like the compute grid or to run the program in background and logout.

To run matlab non interactively, you can use the -batch option

matlab -batch program

program is the program.m file you want to run.

Running code without matlab

If you want to share your code with someone that doesn't have matlab or a machine that doesn't have a licence, you can compile your code from the GUI. There's a short video on this matlab page

On the destination machine, the person will need to install the matlab runtime available here:

You can also compile the code on the command line with mcc. There's many examples on the matlab site:

a short version is:

    mcc -m hello.m -d dir
    cd dir
    ./ /home/usager/matlab/runtime/R2022b/

Line 1, compile the code. Line 2, change directory. Ligne 3, run the compiled code and specify where the runtime is located.


The platform you compile matlab must match the platform where you run the code. You can't compile on Windows and run on Linux for example.