Home 9 Resources 9 Software 9 MATLAB

MATLAB

MATLAB is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages.

MATLAB is available on PSC systems for academic users.   Academic users must complete the MATLAB Request form to request access to MATLAB. Once access has been granted, follow the steps below.

Non-academic users should contact help@psc.edu to discuss how they can get access to MATLAB at PSC.

Sample scripts for MATLAB use are available in directory /opt/packages/examples/matlab on Bridges  and Bridges-2.

Documentation

 

Usage on Bridges-2

To see what versions of MATLAB are available and if there is more than one, which is the default, along with some help, type

module spider matlab

Run MATLAB

You can run MATLAB from the Bridges-2 command line or in a graphical interface.

Run MATLAB from the command line

  1. Start an interactive session on Bridges-2 using the interact command. See the Bridges-2 User Guide for information on interact.
  2. Load the MATLAB module. Note that the module load command is case-sensitive.
    module load matlab
  3. Run MATLAB.  You can run your MATLAB job on as many cores as the node has on which you are running.

    Use a command like 

    matlab -options   < input-file  > output-file

Run MATLAB in a graphical interface

You can run MATLAB in a graphical interface using the X2Go program. X2Go is client-server software; you must have the client installed on your local machine to speak to the server on Bridges-2.

You must download and install an X2Go client for your operating system from https://wiki.x2go.org/doku.php/doc:installation:x2goclient. When that is done, you can run MATLAB in the X2Go interface using these steps:

  1. Start the client X2Go program. From the Session menu select Session > New Session.
  2. Set Session Name to Bridges2-X2Go.
  3. Type bridges2.psc.edu in the Host field.
  4. Set Login to your Bridges-2 username.
  5. Under Session type at the bottom in the dropdown menu on the left select Single application.
  6. In the dropdown on the bottom right select Terminal. Click OK. Please note that Bridges-2 does not provide a desktop environment.
  7. Click the Bridges2-X2Go session on the right and enter your login credentials. Click Ok. This will open an xterm window with a Bridges-2 shell.
  8. Start an interactive session on Bridges-2 using the interact command. See the Bridges-2 User Guide for information on interact.
  9. Load the MATLAB module. Note that the module load command is case-sensitive.
    module load matlab
  10. Run MATLAB.  You can run your MATLAB job on as many cores as the node has on which you are running. The program will open as a window on your desktop. When you are finished close the program, and type “exit” once to exit your interact shell and again to exit the x2go shell.

See what toolkits are available

Once you have started MATLAB, typing

ver

lists all the installed toolkits.  PSC has the PCT toolkit, which is how you can run parallel MATLAB jobs. This command also gives information on your license number, operating system, Java version, etc., which may be useful in diagnosing problems.