Preliminaries

Author :  Thomas Shores
University of Nebraska
Send comments to :  tshores@math . unl . edu

Matrix and Vector Formatting in Mathematica

We are going to cover several aspects of matrices  today.   But first, we need to understand how Mathematica handles matrices and vectors.  This preliminary material (and much more!) is covered in the Mathematica book, pages 437-460.   For example, here is how we would express a  matrix from class  notes that appeared as the augmented matrix of a linear system.  Click on the next cell and press the <Enter> key.

a = {{1,1,1,2},{2,2,4,8},{0,0,2,2}}

This doesn't look very much like a  matrix.  To pretty it up a bit, click on the following cell.

MatrixForm[a]

Notice how a matrix consists of a list of lists (really rows), all of the same length.  From a mathematical point of view vectors are merely special cases of matrices.  However, Mathematica treats a vector as a different sort of object than a matrix.  After all, it is rather inconvenient to define the right hand side vector b as follows:

b = {{2},{8},{2}}

MatrixForm[b]

By the way, because Mathematica has been updated, you can click on and evaluate two cells  at once (or drag the cursor over the  right hand brackets on the cells above and hit <Enter>).

Mathematica prefers to think of b as a simple list, without reference to row or column orientation.  Thus, we could write:

b = {2,8,2}

MatrixForm[b]