MATLAB Programming References

This page provides links to short summaries of MATLAB Programming syntax and technique.

Look at the Examples page for more complete examples of applying MATLAB to a computational task.

Compact list of reference articles

  1. MATLAB Vocabulary
  2. Create Vectors and Matrices
  3. Colon Notation
  4. Create 2D Plots
  5. Creating and Calling Functions
  6. for loops
  7. while loops

Reference articles with short descriptions

MATLAB Vocabulary

Download a PDF document that lists basic MATLAB commands and summarizes concepts in MATLAB programming.

Create Vectors and Matrices

All MATLAB variables are matrices. Vectors are special cases of a matrix with only one row or one column. Scalars are a matrix with one row and one column.

The linspace, ones, zeros functions and the transpose operator are used to create vectors and matrices. The length and size functions are used to inquire about the number of elements in vectors and matrices.

Continue ...

Colon Notation

Colon notation is a powerful shorthand for creating vectors. It is especially helpful when used to create ranges of subscripts to select parts of vectors or matrices.

Continue ...

Create 2D Plots

The versatile plot command is used to create 2D line and scatter plots.

Continue ...

Creating and Calling Functions

MATLAB functions are subprograms that contain a sequence of MATLAB commands, and that are stored in separate m-files. An m-file is a plain text file with the file extension .m.

Continue ...

for loops

for loops are usually designed to be repreated a prescribed number of times. See while loops for the alternative looping structure

Continue ...

while loops

while loops are usually designed to be repeated until a condition is met. See for loops for the alternative looping structure

Continue ...