Matlab

Description

Matlab integrates mathematical computing, visualization, and a powerful language to provide a flexible environment for technical computing. The open architecture makes it easy to use Matlab and its companion products to explore data, create algorithms, and create custom tools that provide early insights and competitive advantages.

Version

  • R2020b

Authorized Users

  • CIRCE account holders
  • SC account holders

Platforms

  • CIRCE cluster
  • SC cluster
  • Workstation/PC

Modules

Matlab requires the following module file to run:

  • apps/matlab/r2020b

License Information

Matlab is available on the cluster for use any current USF student or faculty member. Matlab can also be installed to individual workstations, laptops, and Macs.

To request a copy of the license file and File Installation Key, please send a request to rc-help@usf.edu

Available Products and Toolboxes

  • MATLAB
  • Simulink
  • Bioinformatics Toolbox
  • Communications System Toolbox
  • Control System Toolbox
  • Curve Fitting Toolbox
  • DSP System Toolbox
  • Data Acquisition Toolbox
  • Image Processing Toolbox
  • Instrument Control Toolbox
  • Mapping Toolbox
  • Optimization Toolbox
  • Parallel Computing Toolbox
  • Signal Processing Toolbox
  • SimMechanics
  • Simscape
  • Simulink Control Design
  • Stateflow
  • Statistics Toolbox
  • Symbolic Math Toolbox

Additional Toolboxes with Limited Availability

  • Database Toolbox++
  • Distributed Computing Server
  • Fuzzy Logic Toolbox
  • Global Optimization Toolbox ++
  • Image Acquisition Toolbox ++
  • MATLAB Compiler ++
  • Model Predictive Control Toolbox ++
  • Neural Network Toolbox ++
  • Partial Differential Equation Toolbox
  • System Identification Toolbox ++
  • Wavelet Toolbox

++NOTE: Less than 5 licenses available

Toolboxes with Restricted Availability

  • Computer Vision System Toolbox
  • Fixed-Point Designer
  • HDL Coder
  • Matlab Coder
  • RF Toolbox
  • SimElectronics
  • SimPowerSystems
  • Simulink 3D Animation +++
  • Simulink Coder +++
  • Simulink Design Optimization

+++ NOTE: Only Available with versions r2013a and previous

Installation

  • For Matlab usage outside of CIRCE/SC, please send an email to rc-help@usf.edu to request access.

Running Matlab on CIRCE/SC

The Matlab user guide is essential to understanding the application and making the most of it. The guide and this page should help you to get started with your simulations. Please refer to the Documentation section for a link to the guide.

  • Note on CIRCE: Make sure to run your jobs from your $WORK directory!
  • Note: Scripts are provided as examples only. Your SLURM executables, tools, and options may vary from the example below. For help on submitting jobs to the queue, see our SLURM User’s Guide.

Jobs Shorter than 30 Minutes in Length

Establishing a GUI connection to CIRCE/SC

To use Matlab, you will need to connect to CIRCE/SC with GUI redirection, either using:

  • CIRCE/SC Desktop Environment
  • SSH with X11 redirection
    • If connecting from OSX or Linux via SSH, please ensure that you use one of the following commands to properly redirect X11:
      • [user@localhost ~]$ ssh -X circe.rc.usf.edu
        or
      • [user@localhost ~]$ ssh -X sc.rc.usf.edu

Once connected to CIRCE/SC, you can open Matlab using the steps below:

[user@login0 ~]$ module add apps/matlab/r2020b
[user@login0 ~]$ matlab

More Job Information

See the following for more detailed job submission information:

Jobs Longer than 30 Minutes in Length

To run Matlab jobs on CIRCE/SC, users will need to submit “batch jobs” to the scheduling environment if their jobs takes more than 20 minutes to run on a standard PC.

Serial Batch Jobs

If, for example, you have a Matlab script file (named “matlab-test.m”) with all your functions defined in it, you would set up a submit script like this:

#!/bin/bash
#
#SBATCH --comment=matlab-test
#SBATCH --ntasks=1
#SBATCH --job-name=matlab-test
#SBATCH --output=output.%j.matlab-test
#SBATCH --time=00:10:00

#### SLURM 1 processor Matlab test to run for 10 minutes.

module load apps/matlab/r2020b
matlab -nodisplay -nosplash -r "matlab-test" 

 
Next, you can change to your job’s directory, and run the sbatch command to submit the job:

[user@login0 ~]$ cd my/jobdir
[user@login0 jobdir]$ sbatch ./matlab-test.sh
  • You can view the status of your job with the “squeue -u <username>” command

If you would rather call a different function, make sure the file which contains it is named after the function. For example, if you want to call function ‘addtwo’, make sure it is defined in a file named ‘addtwo.m’.

Matlab will automatically detect any other .m files in the same directory and be able to execute functions within those files.

Parallel Batch Jobs

Parallel batch jobs can be submitted using a script similar to the one below.

#!/bin/bash
#
#SBATCH --nodes=1
#SBATCH --ntasks=10
#SBATCH --job-name=matlab-smp-test
#SBATCH --output=output.%j.matlab-smp-test
#SBATCH --mem=10240
#SBATCH --time=04:00:00

#### SLURM 10 processor Matlab test to run for 4 hours.

module load apps/matlab/r2020b
matlab -nodisplay -r "test_parallel" 

In this example, you would have a Matlab script named test_parallel.m, and in it should be defined a ‘parpool’. Be sure that the ‘—ntasks’ defined in your submit script is 2 more than the number requested using ‘parpool’. In this case, ‘parpool’ would have been set at 8, therefore ‘—ntasks’ is defined as 10. The ‘—mem’ request is the amount of memory to reserve for the job, and is set to 10 gigabytes here. This can be adjusted as necessary.

 
Next, you can change to your job’s directory, and run the sbatch command to submit the job:

[user@login0 ~]$ cd my/jobdir
[user@login0 jobdir]$ sbatch ./matlab-test.sh
  • You can view the status of your job with the “squeue -u <username>” command


Documentation

Home Page, User Guides, and Manuals

More Job Information

See the following for more detailed job submission information:

Reporting Bugs

Report bugs with Matlab to the IT Help Desk: rc-help@usf.edu