Matlab use cases

From UABgrid Documentation
Jump to: navigation, search

Some use cases describing how to offload MATLAB computation to the cluster.


Use MATLAB on a compute node via VNC

This entails running a MATLAB client (GUI) via VNC on a compute node on Cheaha.

This is a typical use case in the following scenarios

  1. Computation needs to be offloaded to a compute node on the cluster to free the user's desktop for development
  2. Computation is too large to be performed on the user's desktop and needs more resources

The vnc session needs to be setup in two stages" 1. Login to cheaha using terminal

$ ssh

2. Start VNC server on Cheaha

$ vncserver 
New ' (USERID)' desktop is

Cheaha will start the vncserver with an available port number. In the above case ":6"

3. Open a new terminal window on the user desktop and connect using port forwarding using the following

$ ssh -L port:localhost:port

where the port number specified in the above command is obtained from

   port = 5900 + port number on which the vncserver is running 

In the above case

port =5900 + 6 = 5906 

The command to connect becomes

$ ssh -L 5906:localhost:5906

Next connect to the vnc server on the Cheaha On the MAC start finder, then cmd+k will bring up the "connect to server" window. (Please make sure You have "screen sharing" turned ON in system preferences. Input the server address as


In the above case


and click Connect. It will open a vnc window with a terminal on the cheaha.

To portforward and login to a compute node use the following command from the terminal in the vnc session

$ qlogin -l vf=memory,h_rt=hr:min:sec

Load the mathworks module and start matlab

$ module load mathworks/R2011b 
$ matlab

MATLAB will now start interactively in the VNC session and is running ont he compute node on Cheaha.

MATLAB Support / Mailing List

As with any application or computer language, learning to use MATLAB to analyze data or to develop or modify MATLAB applications is an individual responsibility. There is ample application documentation available from the Mathworks website, potential outreach to colleagues who also use MATLAB, and options for consultation with Mathworks. Mathworks also host on-campus training seminars several times a year and provides many on-line learning tutorials.

Installation support for MATLAB at UAB is provided by your local IT support organization and the Docs wiki.

Mathworks Website

Your first and best option for application-specific questions on MATLAB is to refer to the on-line MATLAB documentation. The Mathworks site also provides a a support matrix and an on-line knowledge base.


The MATLAB page on the Docs wiki is the starting point for installing MATLAB at UAB and, optionally, configuring it to use cluster computing. All users are encouraged to contribute to the MATLAB knowledge in this wiki, especially if you see areas where improvements are needed. Remember, this knowledge base is only as good as the people who contribute to it.

Contributing to the wiki is as easy as clicking the login link on the top-right of the page and signing in with your UAB BlazerID. If you are unsure about making an edit, you can make suggestions for improvement on the page's Discussion tab or discuss the proposed improvement in the MATLAB user group.


At UAB, MATLAB installation support is provided by your local IT support group. Support for application specific questions is available from peers in your research group. We realize that some people are not as familiar with MATLAB as others. For this reason, we have established a MATLAB user forum (mailing list) where users of MATLAB at UAB can help answer each others questions.

This is a network of volunteers sharing their knowledge with peers. You are encouraged to reach out to this community for questions on using MATLAB by

Archives of MATLAB user group discussions are available on-line at You may find your question is already answered in these archives.

UAB MATLAB announce mailing list

To receive information about UAB's MATLAB license and announcements please subscribe to the matlab-annc mailing list by

Personal tools