MATLAB Primer
Second Edition

Kermit Sigmon
Department of Mathematics
University of Florida

Department of Mathematics = University of Florida = Gainesville, FL 32611
sigmon@math.ufl.edu = sigmon@ufpine.bitnet
Copyright © 1989, 1992 by Kermit Sigmon


Contents

Introduction

  1. Accessing MATLAB
  2. Entering matrices
  3. Matrix operations, array operations
  4. Statements, expressions, variables; saving a session
  5. Matrix building functions
  6. For, while, if --- and relations
  7. Scalar functions
  8. Vector functions
  9. Matrix functions
  10. Command line editing and recall
  11. Submatrices and colon notation
  12. M-files
  13. Text strings, error messages, input
  14. Managing M-files
  15. Comparing efficiency of algorithms: flops and etime
  16. Output format
  17. Hard copy
  18. Graphics
  19. Reference

Copyright © 1989, 1992 by Kermit Sigmon

The MATLAB Primer may be distributed as desired subject to the following conditions:

  1. It may not be altered in any way, except possibly adding an addendum giving information about the local computer installation or MATLAB toolboxes.
  2. It, or any part thereof, may not be used as part of a document distributed for a commercial purpose.

In particular, it may be distributed via a local copy center or bookstore. Users usually appreciate the convenience and durability of a bound copy with a cover, copy center style.


Department of Mathematics = University of Florida = Gainesville, FL 32611 sigmon@math.ufl.edu = sigmon@ufpine.bitnet


Introduction

MATLAB is an interactive, matrix-based system for scientific and engineering calculations. You can solve complex numerical problems without actually writing a program. The name MATLAB is an abbreviation for MATrix LABoratory.

The purpose of this Primer is to help you begin to use MATLAB. They can best be used hands-on. You are encouraged to work at the computer as you read the Primer and freely experiment with examples.

You should liberally use the on-line help facility for more detailed information. After entering MATLAB as described in section 1, the command help will display a list of functions for which on-line help is available; the command help functionname will give information about a specific function. The command help eig, for example, will give information about the eigenvalue function eig. You can preview some of the features of MATLAB by entering the command demo.

The scope and power of MATLAB go far beyond these notes. Eventually you will want to consult the MATLAB User's Guide and Reference Guide. The documentation which accompanies the Student Edition of MATLAB is an excellent source. Copies of the complete User's Guide are often available for review at locations such as consulting desks, terminal rooms, computing labs, and the reserve desk of the library. Consult your instructor or your local computing center to learn where the User's Guides are located at your institution.

MATLAB is available for a number of environments: Sun/Apollo/VAXstation/HP workstations, VAX, MicroVAX, Gould, PC and AT compatibles, 80386 and 80486 computers, Apple Macintosh, and several parallel machines. There is a relatively inexpensive Student Edition available from Prentice Hall publishers. The information in these notes applies generally to all of these environments.

While the second edition of the Primer is based on version 3.5 of MATLAB, it is compatible with version 4.0 with the fundamental differences noted. An edition of the Primer based on version 4.0 is under development.

The plain TeX source (and a PostScript file primer35.ps) of this second edition of the MATLAB Primer is available via anonymous ftp from math.ufl.edu as the file primer35.tex in the directory pub/matlab. If ftp is unavailable to you, it can be obtained via listserv by sending an email message to listserv@math.ufl.edu which contains the single line send matlab/primer35.tex. It can also be obtained by sending a request to the author at sigmon@math.ufl.edu. The latest edition of the Primer will always be available as indicated above as the file primer.tex. A Spanish version is also available there.

MATLAB is licensed by The MathWorks, Inc., Cochituate Place, 24 Prime Park Way, Natick, MA 01760, (508)653-1415, Fax: (508)653-2997, Email: info@mathworks.com.


Copyright © 1989, 1992 by Kermit Sigmon (6-93)


Go to Table of Contents .


HTML conversion by martin.ewing@yale.edu, 7/95