Matlab on the Kent Math/CS Computer Network

Matlab is a scientific computing and visualization system. It is a powerful tool for numerical modeling and analysis of mathematical and scientific problems. The Matlab language is built around matrix/vector data types and can be executed in interactive mode, through a command window (GUI or terminal window), or in batch files, as a high-level programming language.

The system contains a large collection of functions for performing standard numerical calculations (solving linear and nonlinear systems of equations, curve and surface fitting and plotting, quadrature, differential equations, etc.) as well as functions for 2-D and 3-D graphics and for building graphical user interfaces. Some of these functions are internal (precompiled); while others exist as Matlab M-files (source programs written in the Matlab language, which are interpreted at time of execution).

Matlab can be run on any Linux, UNIX, or Windows workstation/PC in our building on which it is properly installed and configured.  Look for a Desktop icon/shortcut or in the "applications" tree.  On Linux and UNIX machines, the execution script should be located in the subdirectory /local/bin/.  On Windows machines, try C:\Program Files\MATLAB\.  If Matlab does not appear to be installed (or needs to be upgraded) on your machine, you can submit a request to systems.

Matlab is also available to be run on any public-access host on the Math and CS networks through a 12-user floating network license.  In addition to the most recent release, Matlab 7.7 (R2008b), 7 legacy versions are available at present:

6.5 (R13 SP1)
7.1 (R14 SP3)
7.2 (R2006a)
7.3 (R2006b)
7.4 (R2007a)/vol/matlab2007a/
7.5 (R2007b)/vol/matlab2007b/
7.6 (R2008a)/vol/matlab2008a/
7.7 (R2008b)

Due to operating-system restrictions, not all versions run on all servers---in particular, as of release R2006a, Matlab no longer supports HP UNIX workstations.  On each machine, the highest supported version is set as the default.  The most recent version, Matlab 7.7 (R2008b), is also the version on the Windows PCs in labs 156 and 158.  Network servers can be accessed by using the Cygwin X-terminal application on the Windows PCs in labs 139, 160, and 162.  Servers include


HP-UX (athena) (minerva)

Linux (pc1) (pc2)

To access one of these servers via Cygwin, first double click on the "X" icon on the Windows desktop.  This should launch an X desktop and a remote-server-selection box.  Select the server of your choice, and when prompted enter your valid user ID and password.  Note that Math accounts are valid on machines; while CS accounts are valid on machines with names.

Upon successfully logging in, a Linux or UNIX desktop will be displayed.  You need to open a terminal/console window in order to launch Matlab.  On Linux machines, a terminal window can be opened from the Main Menu (extreme left button of the lower panel) under "System Tools / Terminal".  To open a terminal window on an HP machine, punch the terminal icon on the lower panel.


Linux/UNIX Server:

To access the Matlab environment on a Linux or UNIX server, type (at the UNIX prompt, "$") After a period of time, you will either get some startup information displayed in your terminal window followed by the Matlab prompt ">>", or the desktop GUI interface (containing a command sub-window) will be launched.  At this point, Matlab is waiting for an input command from you to interpret and execute.  There is a fair amount of overhead associated with the desktop interface and associated JAVA tools.  "Leaner" terminal-window versions can be launched via
$ matlab -nodesktop
which disables the desktop but still starts up the JAVA virtual machine (including the edit/debug and help-browser tools), or
$ matlab -nojvm
which disables both the desktop and JAVA support ("bare bones" version).

A list of command-line options is given by
$ matlab -help
To quit the program, type
>> quit
>> exit
or select "Exit MATLAB" from the File menu on the desktop/GUI versions.

If you wish to display graphics and are executing on a remote host (via an ssh login), then you may need to log in with "X forwarding" enabled, e.g.,

$ ssh -X
If everything is set up properly, then when Matlab is started up, you should see a small graphics window flashed up briefly on your screen.  See Getting Help below if you have problems.

The older, legacy versions of Matlab (6.5, 7.1, 7.2, 7.3, 7.4, 7.5 and 7.6) can be run directly via

$ /vol/matlab6/bin/matlab

$ /vol/matlab710/bin/matlab

$ /vol/matlab2006a/bin/matlab

$ /vol/matlab2006b/bin/matlab

$ /vol/matlab2007a/bin/matlab

$ /vol/matlab2007b/bin/matlab

$ /vol/matlab2008a/bin/matlab

Once you are finished with (and have exited) your Matlab session, you need to log out of the remote server.  You can log off a Linux host by right clicking anywhere on the open desktop area and selecting the "logout" (last) option in the menu you get.  On an HP machine, log out by simply punching the "EXIT" button on the lower panel.

Learning Matlab

For a demonstration of the capabilities and uses of Matlab, enter and point and click your way through its introductory tour.  On the desktop/GUI versions, select "Matlab Help" from the Help menu (or punch the "?" icon on the tool bar).  A thorough introduction can be obtained by reading through the Getting Started link.

Numerous examples of Matlab M-files (which end with the filename extension ".m") are available in the subdirectories under /vol/matlab/toolbox/ (for Linux/UNIX) or C:\Program Files\MATLAB\2008a\toolbox\ (for Windows).

There are numerous on-line introductions and tutorials on Matlab. These have been created by various individuals and are scattered about on the web. Because of the transient nature of much of this type of material, no attempt will be made to maintain any active/current links here. Instead we recommend that you consult the home page of The MathWorks, Inc., the company that owns, distributes, and supports the Matlab software, where up-to-date information can be obtained.

Documentation and References

Matlab has an extensive on-line help system, which can be entered with the command The desktop/GUI versions have the Help System integrated into the desktop; go to the Help menu or click on the "?".

Help on an individual command or topic can be obtained by typing

which displays its output in the command window or which pops up a separate help-browser window.

Numerous books have been written about learning and using Matlab.  An inexpensive pocket paperback that gives a very accessible introduction for new users (at the advanced undergraduate or graduate level) is

MATLAB Primer, 7th Edition
Timothy A. Davis and Kermit Sigmon
Chapman & Hall/CRC Press, 2005
Another book to be recommended (hardback but not very expensive, emphasizing numerical methods) is
Matlab Guide, 2nd Edition
Desmond J. Higham and Nicholas J. Higham
SIAM, Philadelphia 2005

The following paperback is affordable and fairly comprehensive in scope:

Mastering MATLAB 7
Duane C. Hanselman & Bruce Littlefield
Prentice Hall, 2005

It is written somewhat from an engineering perspective and gives a good coverage of such topics as interfacing Matlab with programs written and compiled in other languages, such as C++, Fortran 90/95, and JAVA.

The MathWorks, Inc., the company that owns, distributes, and supports the Matlab software (and related products) has an excellent home page, which includes a great deal of useful information about other books and on-line information and resources related to Matlab, including Matlab News and Notes (a monthly news journal) and the Matlab News Digest (its electronic version). There is also a USENET News Group: comp.soft-sys.matlab.

Getting Help

General help concerning our network and systems is available on the information pages for the Math and CS Computer Systems.

Chuck Gartland /
August, 1997 (original)
January, 2009 (most recent update)