Getting Started With MATLAB

Prepared by the staff of the Indiana University Stat/Math Center

Printer-friendly version: Adobe PDF, 307 KB (Get Acrobat Reader 4.0)


What is Matlab?

MATLAB is a computer program for people doing numerical computation, especially linear algebra (matrices). It began as a "MATrix LABoratory" program, intended to provide interactive access to the libraries Linpack and Eispack. It has since grown well beyond these libraries, to become a powerful tool for visualization, programming, research, engineering, and communication.

Matlab's strengths include cutting-edge algorithms, enormous data handling abilities, and powerful programming tools. The Matlab is not designed for symbolic computation, but does include a Maple kernel for such computations. The interface is mostly text-based, which may be disconcerting for some users.

Matlab is packaged as a core program with several "toolboxes", sold seperately. We will only cover the base package.


How to use this document

This document is intended to be used while sitting at a computer running either NT or the X windows system. It is assumed that you will enter the commands shown, and then think about the result.

The reader of this document should have at least a passing familiarity with linear algebra and be comfortable using computers. In order to be more broadly understood, we will not cover any engineering topics (e.g. signal processing, spectral analysis), though Matlab is commonly used for these tasks. No previous math software experience is necessary, though we will point out important differences between the various packages along the way.

If you are using Matlab over a text-based terminal (such as Telnet or SSH), you might want to follow the Using Math Software under UNIX tutorial after you are finished with this one.

Throughout this document, we will use the following conventions.

ExampleExplanation
File -> OpenChoose the file menu, and select Open.
a = 5Input to be typed at the Matlab prompt.
a =
5
Output from Matlab.
tip arrow
An important tip.

Where to find Matlab

MATLAB is available for many different kinds of computers at Indiana University Bloomington.
  • All Windows Student Technology Centers
  • The Ships and Nations Unix clusters
  • The central servers Steel, Libra, and the Avidd cluster..
A student edition is available from local bookstores for your personal Windows, Macintosh, and Linux systems.

How to Start and Exit Matlab

To start Matlab:
  • On a Windows machine, choose Start Menu ->Programs->Statistics-Math->Matlab.
  • On a Unix machine type matlab to run it interactively.
    Note that plots will be displayed in an X-window, if you have set the DISPLAY variable. You may also type matlab -display hostname:0.
Note that on some machines Matlab may take 15 to 20 seconds to load.
Eventually, you should see:

                                          < M A T L A B >
                              Copyright 1984-2005 The MathWorks, Inc.
                               Version 7.0.4.352 (R14) Service Pack 2
                                          January 29, 2005

 
  New users may want to read "Getting Started with Matlab."
  at http://www.indiana.edu/~statmath/math/matlab/gettingstarted
 
  Please contact statmath@indiana.edu with any questions or comments.

The line >> is the Matlab prompt.
To exit Matlab, type (at the matlab prompt) exit or choose File->Exit MATLAB.

Next: Finding your way around the window