## Matlab/Octave

We can define a matrix in either of the following forms:

> A = [4 0 5; -1 3 2]

> A = [4 0 5
-1 3 2]

You can execute basic matrix operations as follows.
> 5 * A

> A + B

> A * B


EXAMPLES 1. Let , , and .

1. Compute .
2. Is the matrix sum defined?
3. Compute .
4. Compute .

EXAMPLES 2. Compute in each of the following:

1. and .
2. and .

EXAMPLE 3 Let and . Show that these matrices do not commute.

Matlab/Octave can compute the power A^k and the transpose A' of A as follows.

> A^5

> A'


EXAMPLE 4. Let and . Compute and .

EXAMPLE 5. Write the function rmatrix() that will create an matrix with random entries. Then create a matrix with random entries between and .

Department of Mathematics
Last modified: 2005-10-21