Difference between revisions of "Matlab"

From UFRC
Jump to navigation Jump to search
 
(97 intermediate revisions by 8 users not shown)
Line 1: Line 1:
==Installation==
+
{|align=right
Currently matlab is located here:
+
  |__TOC__
<pre>
+
  |}
Version 2009b: /apps/matlab/2009b/
+
__NOEDITSECTION__
</pre>
+
[[Category:Software]][[Category:Language]][[Category:Math]]
 +
{|<!--Main settings - REQUIRED-->
 +
|{{#vardefine:app|matlab}}
 +
|{{#vardefine:url|http://www.mathworks.com/}}
 +
|{{#vardefine:exe|1}} <!--Present manual instructions for running the software -->
 +
|{{#vardefine:conf|}} <!--Enable config wiki page link - {{#vardefine:conf|1}} = ON/conf|}} = OFF-->
 +
|{{#vardefine:job|1}} <!--Enable job script wiki page link-->
 +
|{{#vardefine:policy|}} <!--Enable policy section -->
 +
|{{#vardefine:testing|}} <!--Enable performance testing/profiling section -->
 +
|{{#vardefine:faq|}} <!--Enable FAQ section -->
 +
|{{#vardefine:citation|}} <!--Enable Reference/Citation section -->
 +
|}
 +
<!-- ########  Template Body ######## -->
 +
<!--Description-->
 +
{{#if: {{#var: url}}|
 +
{{App_Description|app={{#var:app}}|url={{#var:url}}|name={{#var:app}}}}|}}
  
==Policies==
+
MATLAB is a programming environment for algorithm development, data analysis, visualization, and numerical computation. Using MATLAB, you can solve technical computing problems faster than traditional programming languages, such as C, C++, and Fortran.
# You may not run MatLab nor compiled MatLab executables interactively on submit1 or submit2.
 
# You must use the test nodes (test01 - test05) to test and compile your MatLab programs.
 
# Long running (more than 30 minutes) MatLab jobs must be submitted to the batch system.
 
# Large numbers of jobs must not be run on the test nodes but must be submitted to the batch system.
 
# The UF HPC Center has no budget for application software and licensing.  All MatLab licenses (including the compiler) come from, and are shared with, all of campus.  For this reason it is sometimes difficult to obtain a license.  If your research depends on MatLab and you do not want to be delayed by licensing issues, you should consider purchasing a MatLab license for your personal or group use.
 
  
==Compiling MatLab Programs==
+
You can use MATLAB in various applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. MATLAB is the language of technical computing for a million engineers and scientists in industry and academia.
 +
<!--Modules-->
 +
==Environment Modules==
 +
Run <code>module spider matlab</code> or <code>module spider mcr</code> to find out what environment modules are available for the MATLAB GUI and for the MATLAB Compiler Runtime. Use Matlab to compile your code and mcr to run it. The mcr does not consume MATLAB licenses.
  
MatLab programs must be compiled via the MatLab compiler before they can be run in batch mode on the HPC Center cluster.
+
==Restrictions==
In order to compile MatLab programs you should
+
The MATLAB install on HiPerGator is restricted to the toolboxes available under the UF license. The complete list of ineligible toolboxes is on the MATLAB website: [https://www.mathworks.com/support/requirements/product-requirements-platform-availability-list.html MATLAB Add-On Availability]
  
1. Once on submit1 or submit2, log into one of the test nodes (test01 - test05) via ssh.  Due to user memory constraints on submit1 and submit2, the MatLab compiler cannot be used on them.
+
Run <code>matlab_show_license_use</code> after loading a Matlab module to see what licenses are available and how many are in use.
<pre>
 
submit1% ssh test05
 
</pre>
 
2. Set up your environment so that the libraries needed by the compiler can be found.
 
<pre>
 
test05% export LD_LIBRARY_PATH=/apps/matlab/2009b/bin/glnxa64:/apps/matlab/2009b/sys/os/glnxa64
 
test05% export PATH=${PATH}:/apps/matlab/2009b/bin
 
</pre>
 
  
'''Note:''' These environment settings should be included in your batch submission script since they will also be needed by the resulting MatLab executable.  
+
==System Variables==
 +
* HPC_{{uc:{{#var:app}}}}_DIR - installation directory
 +
<!--Additional-->
 +
{{#if: {{#var: conf}}|==Configuration==
 +
See the [[{{PAGENAME}}_Configuration]] page for {{#var: app}} configuration details.
 +
|}}
 +
{{#if: {{#var: policy}}|==Usage Policy==
 +
WRITE USAGE POLICY HERE (perhaps templates for a couple of main licensing schemes can be used)
 +
|}}
 +
{{#if: {{#var: testing}}|==Performance==
 +
WRITE PERFORMANCE TESTING RESULTS HERE|}}
 +
{{#if: {{#var: faq}}|==FAQ==
 +
*'''Q:''' **'''A:'''
 +
|}}
 +
{{#if: {{#var: citation}}|==Citation==
 +
If you publish research that uses {{#var: app}} you have to cite it as follows:
 +
X. Yang, K. Dorman and S. Aluru, “Reptile: Representative tiling for short read error correction”, Bioinformatics, 26(20), 2526-2533, 2010.
 +
|}}
 +
==Policies==
 +
# You may not interactively run Matlab or compiled MATLAB executables on the login servers.
 +
# Long running (more than 10 minutes) MATLAB jobs must be in compiled form and submitted to the batch system.
 +
# UF Research Computing has no budget for application software and licensing. All MATLAB licenses (including the compiler) come from and are shared with the entire UF campus. For this reason, it is sometimes difficult to obtain a license, or MATLAB may take a long time to start. If your research depends on MatLab and you do not want to be delayed by licensing issues, you should consider purchasing a MATLAB license for your personal or group use.
  
3a. For batch jobs, you should also set the MCR_CACHE_ROOT environment variable in your PBS job script.
+
==Available components==
<pre>
+
See the [[Matlab add-ons]] for a full list of licensed MATLAB components.
test05% export MCR_CACHE_ROOT=${TMPDIR}
 
</pre>
 
  
Please see the [[PBS Sample Job Scripts]] for a sample MatLab submission script.
+
==Compiling MatLab Programs==
 
+
MATLAB programs must be compiled via the MATLAB compiler before they can be run in batch mode on HiPerGator. To compile MATLAB programs, you should
3b. For an interactive run (only on the test nodes), you should set MCR_CACHE_ROOT to a directory /scratch/local.
 
 
 
<pre>
 
test05% mkdir -p /scratch/local/$USER/mcr_cache
 
test05% export MCR_CACHE_ROOT=/scratch/local/$USER/mcr_cache
 
</pre>
 
 
 
4. Compile your matlab program (.m) files using the MatLab compiler ([[mcc]]).
 
<pre>
 
test05% mcc -R -singleCompThread -m some_prog.m
 
</pre>
 
  
 +
# See [[Development and Testing]] page to learn how to get an interactive developmental session on HiPerGator under SLURM.
 +
# Set up your environment so that the libraries needed by the compiler can be found.
 +
#*<pre>module load matlab</pre>
 +
#*'''Note:''' The module load command should also be included in your batch submission script since your compiled Matlab executable must also find the appropriate dynamically loaded libraries.
 +
# Compile your MATLAB program (.m) files using the MatLab compiler.
 +
#*<pre>mcc -R -singleCompThread -m some_prog.m</pre>
 +
#*'''Note:'''  The "<code>-R -singleCompThread</code>" options on the mcc command line will result in a '''single-threaded''' executable. By default, multithreading is enabled in executables produced by mcc.  One computational thread will be started for each processor in a machine that runs your executable. That's not usually what you want. Unless you know what you are doing and intend to take advantage of multithreading (including requesting the appropriate resources in your submission script), you should use these options and generate a '''single-threaded''' executable.
 
===Example===
 
===Example===
Let us say that we have a program such as that below in a source file named houdini.m
+
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
 +
''Expand this section to view MATLAB example.''
 +
<div class="mw-collapsible-content" style="padding: 5px;">
 +
Let us say we have a program like that below in a source file named houdini.m
 
<pre>
 
<pre>
 
function [m,t] = houdini();
 
function [m,t] = houdini();
Line 61: Line 84:
 
disp(t);      % Display the value of t.
 
disp(t);      % Display the value of t.
 
</pre>
 
</pre>
Since we already have the environment setup, we can compile this program. It is recommended that this be done in a separate directory as a number of files are produced.
+
Since we already have the environment set, we can compile this program. It is recommended that this be done in a separate directory as several files are produced.
 
<pre>
 
<pre>
  test05% mkdir tmp
+
  mkdir tmp
  test05% cd tmp
+
  cd tmp
  test05% cp ../houdini.m .
+
  cp ../houdini.m .
  test05% ls
+
  module load matlab
houdini.m
+
  mcc -R -singleCompThread -m houdini.m  
test05% export LD_LIBRARY_PATH=/apps/matlab/2009b/bin/glnxa64:/apps/matlab/2009b/sys/os/glnxa64
+
  ls -l
test05% export PATH=${PATH}:/apps/matlab/2009b/bin
 
  test05% mcc -R -singleCompThread -m houdini.m  
 
Warning: Unable to open display , MATLAB is starting without a display.
 
  You will not be able to display graphics on the screen.
 
  test05% ls -l
 
 
total 124
 
total 124
 
-rwxr-xr-x  1 root root 12299 Apr  3 10:08 houdini
 
-rwxr-xr-x  1 root root 12299 Apr  3 10:08 houdini
Line 85: Line 103:
 
-rwxr--r--  1 root root  1446 Apr  3 10:08 run_houdini.sh
 
-rwxr--r--  1 root root  1446 Apr  3 10:08 run_houdini.sh
 
</pre>
 
</pre>
The MatLab executable '''houdini''' has been generated.
+
The MATLAB executable '''houdini''' has been generated and can be run by typing ./houdini, or by putting that command in a batch submission script.
 +
</div></div>
 +
----
 +
[http://www.mathworks.com/access/helpdesk/help/toolbox/compiler MATLAB Compiler Documentation] can be found on the MatLab Website.
  
'''Note:''' the <code>-R -singleCompThread</code> options on the mcc command.  By default, multithreading is enabled in executables produced by mcc - one computational thread will be started for each processor in a machine that runs your executable.  That's not usually what you want.  Unless you know what you are doing and intend to take advantage of multithreading (including requesting the appropriate resources in your submission script) you should use these options and generate a single-threaded executable.  Otherwise, your MatLab jobs will oversubscribe the compute nodes and interfere with other users' programs.
+
==MATLAB GUI use on HiPerGator==
----
 
Documentation for the MatLab compiler can be viewed on the [http://www.mathworks.com/access/helpdesk/help/toolbox/compiler MatLab Website].
 
  
==Frequently Asked Questions==
+
If you must use the Graphical User Interface for MATLAB, use [[Open OnDemand|Open on Demand]]
<pre>
 
Dear Sirs,
 
  
I have a basic question about what can be run on the cluster. I have a
+
==MATLAB online training==
standalone C application file generated by the Matlab compiler. Is it
 
possible to run it (after porting/copying the required libraries) as an
 
external application on a particular node of the cluster. This is
 
because it is not possible for me to compile the C source files on the
 
cluster itself?
 
</pre> 
 
OK... from what I gather here, I think you have the following:
 
  
# A compiled executable, most likely in linux x86 format.
+
Mathworks also has several free [https://www.mathworks.com/services/training.html online training resources].
#: This executable obviously requires specific libraries to run, and if we don't have them installed they won't work. From what I remember of the matlab compiler suite, it is possible for the matlab compiler to actually generate a full set of files that include your executable and the libraries it needs to support it such that the whole suite is portable. This is what you really want to look for, and I know it has been done before.
 
# Possibly the source code.
 
#: If you have the C source code, you should be able to compile that source code on our systems with out any trouble, unless it requires some sort of library provided by matlab. If this is the case, then option 1 above is your best bet.
 
===Where is the Distributed Computing Toolbox?===
 
It hasn't been added because we do not have a license for the distributed computing toolbox. The University of Florida has not opted for that particular option, and our group does not have the money to purchase this particular license, as it is very expensive.
 
===Compiled DLL===
 
If you have compiled a DLL to use as an executable, it will not work on the cluster. DLL's are Microsoft Windows based dynamically linked libraries that matlab would be able to run on a Windows machine in a faster method because it would not have to do any compiling of its own. Basically it is the same thing as a matlab byte-compiled package. A number of different software packages and languages out there use the same methodology, such as Java and emacs-lisp.
 
===Setting a Path===
 
In order to set a path, in your matlab script you would put the following:
 
<pre>
 
path(path, '/path/to/wherever/you/want')
 
</pre>
 
This would add a search path to the matlab system. This is also detailed on the [http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/path.html&http://www.google.com/search?hl=en&q=matlab+set+path&btnG=Google+Search&aq=f&oq= Matlab] website.
 
  
You can also set a path for the compiler to look at via the command line:
 
-a <pathname>
 
  
 +
==Compiled DLL==
 +
If you have compiled a MATLAB DLL to use as an executable, it will not run on the cluster. DLL's are Microsoft Windows based dynamically linked libraries that will only work under the Windows operating system.
  
==Troubleshooting==
+
==Setting a Command Path==
===2008a===
+
To set a command path in your MATLAB program, should add the following code.
When version 2008a was installed on our system, it installed fine but when run it would complain about glibc being too old. The error message given my matlab looked like the following:
 
 
<pre>
 
<pre>
****************************************************************************************************
+
path(path, '/path/to/matlab/binaries')
Error: The MATLAB script returned a bad status while determining
 
      environment variables. There appears to be a problem
 
      with your MATLAB installation. You must fix the problem
 
      before mcc can work. Any messages from the script
 
      follow . . .
 
 
 
 
 
----------------------------------------------------------------------------
 
Warning: glibc 2.3.4      - Unsupported version
 
        glibc 2.3.6      - MATLAB built using this version
 
----------------------------------------------------------------------------
 
-> Your configuration APPEARS to be too OLD to run this MATLAB program!
 
----------------------------------------------------------------------------
 
  For system requirements consult http://www.mathworks.com ...
 
 
 
***************************************************************************
 
 
</pre>
 
</pre>
In order to fix this problem, we first searched on the web to find that there was a patch available from Mathworks if you asked them for it. We did just this, and the fix turned out to be very simple. Unfortunately it appears that no one else has bothered to publish this fix, so here it is:
+
This will add the specified directory to the MATLAB search path. For more information, see the [http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/path.html&http://www.google.com/search?hl=en&q=matlab+set+path&btnG=Google+Search&aq=f&oq= Matlab] web site.
<pre>
 
--- oscheck.sh    2008-05-28 09:48:55.000000000 -0400
 
+++ oscheck.sh.old    2007-12-02 01:34:35.000000000 -0500
 
@@ -102,7 +102,7 @@
 
#                  of the data. Set oscheck_debug=0 for shipping.
 
#
 
# Copyright 1996-2007 The MathWorks, Inc.
 
-# $Revision: 1.1.12.1 $  $Date: 2008/03/24 17:59:41 $
 
+# $Revision: 1.1.6.4 $  $Date: 2007/12/03 21:53:17 $
 
#----------------------------------------------------------------------------
 
#
 
  
@@ -153,8 +153,8 @@ else
+
==Known Issues==
#                  arch  OSprefix minimum_ver release_ver future_ver
+
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
#
+
''Expand this section to view common troubleshooting steps.''
oslist="        sol64  SunOS    5.10        5.10        -"
+
<div class="mw-collapsible-content" style="padding: 5px;">
-        oslist="$oslist glnx86  glibc    2.3.4      2.3.4      -"
+
===No Licenses Available===
-       oslist="$oslist glnxa64 glibc    2.3.4      2.3.4      -"
+
You may run into an error when using the MATLAB compiler, such as
+        oslist="$oslist glnx86  glibc    2.3.6      2.3.6      -"
 
+        oslist="$oslist glnxa64 glibc    2.3.6      2.3.6      -"
 
oslist="$oslist mac    Darwin  8.7.0      8.7.0      -"
 
oslist="$oslist maci    Darwin  8.7.0      8.7.0      -"
 
oslist="$oslist maci64  Darwin  9.0.0      9.0.0      -"
 
</pre>
 
====Compiler Issues====
 
You may run into an error when using the matlab compiler that looks something like this:
 
  
 
'''Licensed number of users already reached.'''
 
'''Licensed number of users already reached.'''
  
In this case what is probably happening is that the number of licenses for the matlab compiler has been exhausted. The University only has two licenses, and if they are currently being used then this is the error that will be issued.
+
If so, the number of licenses available for the MATLAB compiler has been exceeded. Only two are shared among the entire university, so you should expect to see this problem occasionally if you use the MATLAB compiler frequently. If the problem persists for over a few hours, please open a [https://support.rc.ufl.edu support request].
  
'''"Could not access the MCR component cache." error message'''
+
===MCR_CACHE_ROOT Directory===
 +
'''Could not access the MCR component cache'''
  
What is happening here is that matlab is not able to access the MCE cache directory, which it expects to be in your home directory. The reason this is happening is that we have found that when a large number of these programs are running at the same time, the load on the home area file system is too great, and we start having problems with the filesystem.
+
This error message means that MATLAB cannot access the MCR cache directory. When you load the MATLAB module, MCR_CACHE_ROOT is set for you, and you should not encounter this error. If you do, please open a  [https://support.rc.ufl.edu support request]. For batch jobs, <code>module load matlab</code> uses the $TMPDIR variable, and MCR_CACHE_ROOT is set to $TMPDIR/mcr_cache. For non-batch jobs, MCR_CACHE_ROOT is set to /scratch/local/$USER/mcr_cache
 
+
In order to solve this problem, you just need to do the following:
+
===Older Versions===
export MCR_CACHE_ROOT=$TMPDIR
+
To use older versions of MATLAB that are installed on the cluster, you can list them via the following command:
 
+
<pre>
This redirects the cache to a temp directory that is able to handle the traffic.
+
$ module spider matlab
 
+
</pre>
==Installation Notes==
+
If you were to see that an older version of MATLAB is available, such as version r2012a, you would then load the appropriate module for that version:
===Licensing===
+
<pre>
The matlab license is a floating license provided to us from the University. As such, we cannot be using hundreds if not thousands of licenses from this provision, as we would completely wipe out the ability of the rest of the university to use the software.
+
$ module load matlab/2012a
 
+
</pre>
As such, matlab licenses can only be used from select machines, typically submit and test nodes.
+
</div></div>
 
 
This is done by copying ''/etc/matlab.dat'' from submit to whatever nodes need to have the license. The software installation of matlab in /apps has a symbolic link to this file, so if the file is there it can read the license, and if not the software will not work.
 
===Installation Notes===
 
See [[matlab installation]] for more details.
 

Latest revision as of 16:06, 28 November 2023

Description

matlab website  

MATLAB is a programming environment for algorithm development, data analysis, visualization, and numerical computation. Using MATLAB, you can solve technical computing problems faster than traditional programming languages, such as C, C++, and Fortran.

You can use MATLAB in various applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. MATLAB is the language of technical computing for a million engineers and scientists in industry and academia.

Environment Modules

Run module spider matlab or module spider mcr to find out what environment modules are available for the MATLAB GUI and for the MATLAB Compiler Runtime. Use Matlab to compile your code and mcr to run it. The mcr does not consume MATLAB licenses.

Restrictions

The MATLAB install on HiPerGator is restricted to the toolboxes available under the UF license. The complete list of ineligible toolboxes is on the MATLAB website: MATLAB Add-On Availability

Run matlab_show_license_use after loading a Matlab module to see what licenses are available and how many are in use.

System Variables

  • HPC_MATLAB_DIR - installation directory



Policies

  1. You may not interactively run Matlab or compiled MATLAB executables on the login servers.
  2. Long running (more than 10 minutes) MATLAB jobs must be in compiled form and submitted to the batch system.
  3. UF Research Computing has no budget for application software and licensing. All MATLAB licenses (including the compiler) come from and are shared with the entire UF campus. For this reason, it is sometimes difficult to obtain a license, or MATLAB may take a long time to start. If your research depends on MatLab and you do not want to be delayed by licensing issues, you should consider purchasing a MATLAB license for your personal or group use.

Available components

See the Matlab add-ons for a full list of licensed MATLAB components.

Compiling MatLab Programs

MATLAB programs must be compiled via the MATLAB compiler before they can be run in batch mode on HiPerGator. To compile MATLAB programs, you should

  1. See Development and Testing page to learn how to get an interactive developmental session on HiPerGator under SLURM.
  2. Set up your environment so that the libraries needed by the compiler can be found.
    • module load matlab
    • Note: The module load command should also be included in your batch submission script since your compiled Matlab executable must also find the appropriate dynamically loaded libraries.
  3. Compile your MATLAB program (.m) files using the MatLab compiler.
    • mcc -R -singleCompThread -m some_prog.m
    • Note: The "-R -singleCompThread" options on the mcc command line will result in a single-threaded executable. By default, multithreading is enabled in executables produced by mcc. One computational thread will be started for each processor in a machine that runs your executable. That's not usually what you want. Unless you know what you are doing and intend to take advantage of multithreading (including requesting the appropriate resources in your submission script), you should use these options and generate a single-threaded executable.

Example

Expand this section to view MATLAB example.

Let us say we have a program like that below in a source file named houdini.m

function [m,t] = houdini();
% Doc example, chapter 3.

% Copyright 1997 The MathWorks, Inc.
% $Revision: 1.1.6.1 $

m = magic(2); % Assign 2x2 matrix to m. 
t = m .^ 3;   % Cube each element of m. 
disp(t);      % Display the value of t.

Since we already have the environment set, we can compile this program. It is recommended that this be done in a separate directory as several files are produced.

 mkdir tmp
 cd tmp
 cp ../houdini.m .
 module load matlab
 mcc -R -singleCompThread -m houdini.m 
 ls -l
total 124
-rwxr-xr-x  1 root root 12299 Apr  3 10:08 houdini
-rw-r--r--  1 root root 63146 Apr  3 10:08 houdini.ctf
-rw-r--r--  1 root root   239 Apr  3 10:06 houdini.m
-rw-r--r--  1 root root  2900 Apr  3 10:08 houdini_main.c
-rw-r--r--  1 root root  6328 Apr  3 10:08 houdini_mcc_component_data.c
-rw-r--r--  1 root root  5461 Apr  3 10:08 houdini.prj
-rw-r--r--  1 root root  1010 Apr  3 10:08 mccExcludedFiles.log
-rw-r--r--  1 root root  6757 Apr  3 10:08 readme.txt
-rwxr--r--  1 root root  1446 Apr  3 10:08 run_houdini.sh

The MATLAB executable houdini has been generated and can be run by typing ./houdini, or by putting that command in a batch submission script.


MATLAB Compiler Documentation can be found on the MatLab Website.

MATLAB GUI use on HiPerGator

If you must use the Graphical User Interface for MATLAB, use Open on Demand

MATLAB online training

Mathworks also has several free online training resources.


Compiled DLL

If you have compiled a MATLAB DLL to use as an executable, it will not run on the cluster. DLL's are Microsoft Windows based dynamically linked libraries that will only work under the Windows operating system.

Setting a Command Path

To set a command path in your MATLAB program, should add the following code.

path(path, '/path/to/matlab/binaries')

This will add the specified directory to the MATLAB search path. For more information, see the Matlab web site.

Known Issues

Expand this section to view common troubleshooting steps.

No Licenses Available

You may run into an error when using the MATLAB compiler, such as

Licensed number of users already reached.

If so, the number of licenses available for the MATLAB compiler has been exceeded. Only two are shared among the entire university, so you should expect to see this problem occasionally if you use the MATLAB compiler frequently. If the problem persists for over a few hours, please open a support request.

MCR_CACHE_ROOT Directory

Could not access the MCR component cache

This error message means that MATLAB cannot access the MCR cache directory. When you load the MATLAB module, MCR_CACHE_ROOT is set for you, and you should not encounter this error. If you do, please open a support request. For batch jobs, module load matlab uses the $TMPDIR variable, and MCR_CACHE_ROOT is set to $TMPDIR/mcr_cache. For non-batch jobs, MCR_CACHE_ROOT is set to /scratch/local/$USER/mcr_cache

Older Versions

To use older versions of MATLAB that are installed on the cluster, you can list them via the following command:

$ module spider matlab

If you were to see that an older version of MATLAB is available, such as version r2012a, you would then load the appropriate module for that version:

$ module load matlab/2012a