Department of Computer Science and Technology


MATLAB is a commercial programming language and environment for numerical computations. Numeric arrays are its primary data type. MATLAB gives easy access to a wide range of efficient numeric algorithms, visualization techniques, and domain-specific extensions (“toolboxes”). The Computer Laboratory holds a license for some of the research applications not included in the Campus agreement.

Using MATLAB in the department

For Linux, the current version is installed for everyone under /usr/groups/matlab/current on the filer. Care is taken to ensure that this is in step with the licence server. Some Linux machines have a local command cl-matlab installed to access the current version from the default path.

Windows users have to install MATLAB on their local harddisk The current version is available on \\filer\install\.

You should carry out a non-network install first. After this install is complete, you may need to install again if you find that there are missing toolkits. You can find the install codes for both steps on the Matlab wiki page.

In any case make sure your license file has in it:-

    SERVER 0011116e04b4 2700 

Using Matlab at home

If possible install the Campus licensed version alone. If you want access to the additional toolkits, you will need two things:

  • A connection to a Computer Laboratory MATLAB license server.
  • The MATLAB software.

Tunneling to the licence server

To use MATLAB, you need two TCP connections to a departmental MATLAB licence server. For members of the department, the server is using TCP ports 2700/2701. Some care is necessary to get this working, because these ports are blocked from outside access by the departmental firewall. It is best to establish this connection, as described below, before actually installing MATLAB, because this way the installation process can talk to the licence server and install exactly the components for which you can get a licence.


Under Windows, as a member of the department, simply activate a Computer Lab VPN connection to circumvent the departmental firewall.


Under Linux, use this script to establish an ssh tunnel connection to the departmental MATLAB licence server:

# Open ssh connection to the Computer Laboratory and tunnel
# matlab licence server ports
cat <<'EOF'
The following local ports are now forwarded via SSH to the Computer Lab:

  localhost:2700  ->
  localhost:2701  ->
ssh -N -x \
    -L \
    -L \

Note: A more fancy version of the above script, which also tunnels rdesktop, http, Kerberos authentication, SMB/CIFS access to elmer, and access to the Altera licence server, can be found at /home/mgk25/w/scripts/tunnel-cl.

Installing MATLAB

Members of the department who wish to install the CL toolkits on a home desktop machine should contact sys-admin.

Install according to instructions. As you already have a File Installation Key, choose “Install manually without using the Internet”. You do not have to install the licence manager on your machine, as you will be using the one installed in the Computer Laboratory.

During the installation process, you will be asked for your local license.dat file. Members of the department set this to:

  SERVER localhost 0011116e04b4 2700

This tells MATLAB to contact these ports on your local machine, where your ssh tunnel will forward the connection to the respective licence server.

For comparison: The /usr/groups/matlab/current/etc/license.dat file used on Computer Lab Linux machines contains the line

  SERVER 0011116e04b4 2700

This is the real network address of the licence server, along with the Ethernet MAC address to which its licence has been tied and the first of the two ports to contact.

After installation, you may also want to change .../toolbox/local/docopt.m to point to your favourite web browser.


Please do not forget to quit MATLAB as soon as you are not using it. Remember that others in the lab may already be queueing to use the licences that you're blocking. The etc/lmstat -a command will show you who currently uses which license.

Running MATLAB on your home PC this way is a HACK, not an officially supported service. It is perfectly proper and legal, because you still use a valid licence, but it comes without any support from sys-admin staff.


While MATLAB has probably been one of the most popular numerical environments for the last two decades in many research disciplines, there are now several free alternatives available:

  • The NumPy package adds to the Python programming language the main features that distinguished so far Matlab from other programming languages: powerful N-dimensional numeric array objects and efficient linear-algebra and Fourier-transform functions that operate on these. Have a look at NumPy for Matlab Users. The Matplotlib package adds on top of NumPy visualization facilities that are very comparable with those of MATLAB, and comes in addition to a native object-oriented API also with an alternative PyLab API that is designed to be very familiar to experienced MATLAB users. The SciPy library adds to all that a number of further algorithms for scientific computing.
  • Octave is a free reimplementation of the MATLAB programming environment.
  • Scilab is another open-source contender in this field.

You may want to try Octave if you are looking for a compatible drop-in replacement for MATLAB. Try Python + NumPy + Matplotlib if you are looking for a much neater and more flexible programming language that offers comparable capabilities and is much easier to use as a scripted environment (CGI, Makefile, etc.).

We don't know of a recommended free alternative for Simulink (perhaps GNU Radio for radio communications projects). There is also not quite as rich a set of domain-specific toolboxes available for MATLAB alternatives as there is for the original, and you may find the documentation somewhat more rudimentary.