Print this article Edit this article
Running Matlab on Servers
Running jobs on a server
sshinto a server.- Start a screen session:
- something like "screen -S matlab-program_name"
- Run your job
- Decide where you want to run the program. For this example I will have it in my home directory (U: or W: drive on windows)
- run the job: ml matlab; matlab -nodisplay < program_name.m
- Once the job is running you can do "ctrl-a d" to detach from the session
- check on it periodically to see if it is done:
- ssh into server
- reattach to the screen session: "screen -r" or "screen -r name-you-gave-the-session"
- if it's done type "exit" to end your session
- or "ctrl-a d" to detach and check on it later
Using the GUI
Here's how to access Matlab with a graphical user interface (GUI). Please note that performance might be slow unless you have a fast Internet connection.
- Start an X server (such as VcXsrv or Cygwin, you would have to download and install one of these packages on a "self-supported" system).
- ssh with X11 packet forwarding into a host using an application like SecureCRT. (If you are using a "self-supported" or personally-owned computer, you may download SecureCRT.)
- Start the GUI by typing the following commands:
- module load matlab -> more information can be found here
- matlab
- This should get around the lack of proper video drivers.
- If you get a display that is just black using XQuartz you can try the following:
via : Matlab GUI displays black with XQuartz
- create a file "java.opts" in the home folder
- edit to contain:
-Dsun.java2d.xrender=false
-Dsun.java2d.pmoffscreen=false - restart matlab from home
- see if this solves the issue
Last Modified:
Oct 28, 2025 10:06 am GMT-4
Created:
May 1, 2019 3:04 pm GMT-4
by
admin
JumpURL: