Gerald Recktenwald's MATLAB Page
MATLAB is a commercial program for interactive numerical
analysis. I use it extensively in my research and teaching,
and for many day-to-day tasks, including data
reduction, curve fitting, and plotting of technical data.
This page provides a few links to the current and potential MATLAB users.
It is not meant as an endorsement.
Computer users are susceptible to endless debates on the merits of various
hardware manufacturers, operating systems, programming languages,
productivity applications, etc. These discussions often devolve into highly
emotional and hostile arguments akin to religious or ethnic conflict.
While acknowledging the ultimate futility of arguing whether Bhudda is
better than Jesus, or whether Ford is faster than Chevy, it is still useful for
those not already familiar with MATLAB to answer the question, ``Why use
MATLAB for numerical analysis?''. The answers provided here are not
the answers to ``Why is MATLAB better than language X?'', or
``Why is MATLAB better than application Y?''.
MATLAB is useful for numerical analysis for the following reasons.
- It incorporates very high quality software libraries developed by
numerical analysts and software developers throughout the world.
- The source code for nearly all of the high level algorithms used
by MATLAB is available. MATLAB consists of a highly optimized
kernel which handles basic arithmetic and linear algebra operations
(LU, Cholesky, QR, and SVD factorizations, eigenvalue computation,
sparse matrix manipulation) as well as FFT and inverse FFT.
Though the Mathworks customized source code for these functions is not available,
the kernels are based on the LAPACK
library. The Fortran source for these routines can be downloaded and
inspected. The source code for higher level analysis (curve fitting,
interpolation, quadrature) is available in the standard MATLAB distribution.
This allows users to learn from the source code, and to modify to their
own needs, if necessary.
- It is interactive. Substantial analysis can be performed
by entering one command at a time and thereby obtaining results.
This encourages experimentation and eliminates the ``compile-link-execute''
cycle required by compiled languages.
- It integrates plotting and analysis in one set of commands (one
language). This makes it possible to instantly obtain graphical
results without having to export data to another program.
- It offers high level abstractions for linear algebra operations.
Manipulation of vectors and matrices, including solving linear
systems, is supported by intuitive extension of the basic
addition, subtraction, multiplication, and division operators.
- It dynamically manages memory for matrices and vectors. This makes
it unnecessary to specify the size of matrix and vector variables,
and it allows the size of these variables to be changed
at will.
- It transparently performs operations on complex and real valued
numerical quantities. For example, when the expression y = sqrt(x)
is evaluated, MATLAB automatically produces a real or complex
y depending on the sign of x.
- It supports structured programming. Software libraries can be
developed in MATLAB for sophisticated and highly customized
analysis. Furthermore, MATLAB algorithms can be directly
translated to C or Fortran, and there is a provision for linking
C and Fortran codes to MATLAB.
- It is widely used as a teaching and research tool.
MATLAB is sold by the Mathworks,
a company in Natick, Massachussets. Their web site has a ton of good
information including reference books, technical notes, and lots of
MATLAB source code.
For an ongoing source of information be sure to read the
MATLAB newsgroup
The Mathworks created an eight minute movie about the origins of MATLAB.
The movie features
Cleve Moler,
who wrote the first version of MATLAB
and who founded the Mathworks with
Jack Little. The movie shows photos of
a handful of influential mathematicians who developed the first digital
algorithms for matrix manipulations. If you have the bandwidth, this
movie is definitely worth the time it takes to watch. On 15 Sept 2007
the movie was available as flash movie on
this page
The full version of MATLAB is not cheap, although the student version
is a good investment at approximately $100 (US). For a while in the early
2000s, it appeared
that the Mathworks was concentrating its efforts on the Windows Operating
system. In 2007 MATLAB is available on Macintosh OS X as well as these
flavors of linux: Red Hat,
Fedora Core 4, Debian 3.1, SUSE 9.3 and other distributions having the
appropriate kernel support.
The following list contains alternatives to
MATLAB, including freeware clones and similar commericial packages.
I have not personally used all of these packages, but you should
at least know they exist.
- R
- Software system for statistical analysis and plotting.
- Freeware
- Available for Unix/Linux, Wintel PCs and Macintosh.
- Scilab
- Interactive system for matrix computations.
- Freeware
- Available for Unix/Linux, Wintel PCs and Macintosh.
- OCTAVE
- Interactive system for matrix computations, largely compatible
with MATLAB m-files.
- GPL Freeware
- Available for Unix/Linux, Wintel PCs and Macintosh.
- O-Matrix
- Interactive system for matrix computations, with MATLAB compatibility mode
that supports MATLAB syntax.
- Commercial product with licencing similar to MATLAB
- Available for Wintel PCs only.
- Python
- A scripting language useful for text processing, file manipulation, GUI
development, image processing and numeric computation.
- I use python
(where I used to use perl) for manipulating text files and generating web pages.
The Python language
has significantly different suntax from MATLAB, and porting
MATLAB code to Python requires a good understanding of both languages.
Despite this hurdle, some MATLAB programmers are attracted to Python
because of its broad capabilities, its ability to do interactive computing,
its open source community, and its numeric library called
NumPy.
The SciPy library
library is a relatively new and promising python library
for scientific computing. The
matplotlib
package provides a library of MATLAB-like plotting commands for Python.
- Open source with its own Python Software License.
- Free to download and use.
- Available for Unix/Linux, Wintel PCs and Macintosh. Python is included in
most Linux distributions. Version 10.3 of Mac OS X comes with the
base python package preinstalled. Free binary installers for Windows,
Linux, and Mac OS X
are available from
ActiveState.
Extensions for Python on Mac OS (in addition to those provided by
Apple) are available from the
MacPython
site and
Bob Ipollito's web site.
- TeLa the Tesor Language
- Interactive system for matrix computations using Fortran-90 style array language.
- GPL Freeware
- Available for Unix/Linux.
- RLaB
- Interactive system for matrix computations. Some MATLAB-like
syntax and MATLAB->Rlab converter is available.
- GPL Freeware and OS-specific binaries
- Available for Unix/Linux, Wintel PCs and Macintosh.
- Yorick
- Interactive system for matrix computations.
- GPL Freeware and OS-specific binaries
- Available for Unix/Linux, Wintel PCs and Macintosh.
- EULER
- Interactive system for matrix computations.
- Freeware
- Available for Unix/Linux, Wintel PCs and Macintosh.
- GAUSS
- Interactive system for matrix computations.
- Commerical Product.
- Available for Unix/Linux, and Wintel PCs.
- IDL
- Interactive Data Language.
- Commerical Product.
- Available for Unix/Linux, Wintel PCs and Macintosh.
Some years ago I put together an on-line guide to using MATLAB called the
MATLAB Hypertext Reference.
It hasn't been updated in a long time and there are
still quite a few missing pieces. You might find it useful,
especially if you are just getting started with MATLAB.
For the past several years I have taught our junior level
numerical methods course,
ME 352.
MATLAB is used as the computing and programming environment for
that class.