Chapter 5. Matrices

Matrices are entered by enclosing the values in [ ]. Each item in a row is separated by a , and each row is separated by a ;.

entering [1,2] will produce the 1 by 2 matrix

[1 2]

entering [1,2;3,4] will produce the 2*2 matrix

[1 2]

[3 4]

entering [1;2] will produce the 2*1 matrix

[1]

[2]

The identity matrix can be entered using the function eye with the size of the matrix as the parameter. A zero filled matrix can be entered using the zeros function. This accepts either one parameter to produce a square matrix or two to produce a rectangular matrix. A one filled matrix can be entered using the ONES function. This accepts either one parameter to produce a square matrix or two to produce a rectangular matrix.

A one dimensional matrix containing a series of numbers can be created using the colon operator either with the form

start : end

start : increment : end

e.g

2:9 = [2,3,4,5,6,7,8,9]

2:2:8 = [2,4,6,8]