## Introduction

A matrix is a two dimensional rectangular array of quantities or expressions in rows and columns that is treated as a single entity and manipulated according to particular rules. Often these elements will be numbers.

Matrices can be considered as an (ordered) collection of vectors. Specifically, an m by n matrix is equivalent to n Euclidean column vectors of dimension m.

_{1}a

_{2}. . . ]

Similarly, we may also consider row vectors, so that an m by n matrix is equivalent to m Euclidean row vectors of dimension n.

## Form

The notation

_{ij})

denotes a matrix, where a_{ij} is the entry at the i^{th} row and j^{th} column (the ij-entry).

## Use

### Example

The matrix

can be considered as three 2-dimensional column vectors

A = [a_{1}a

_{2}a

_{3}], a

_{1}= [ 1 ], a

_{2}= [ 2 ], a

_{3}= [ 3 ] 4 5 6

### Example

It can also be considered as two 3-dimensional row vectors. A = [ b_{1}], b

_{1}= (1, 2, 3), b

_{2}= (4, 5, 6) b

_{2}

For example, for three column matrices A = [a_{1} a_{2} a_{3}], B = [b_{1} b_{2} b_{3}], we have

_{1}+ b

_{1}a

_{2}+ b

_{2}a

_{3}+ b

_{3}], cA = [ca

_{1}ca

_{2}ca

_{3}].

## Dialog

Use a comma to separate columns.

## Code

The following is the javaScript code.

## Use

### Example

_{2})4*3 = [ 12 22 32 ] = [ 1 4 9 ] 12 22 32 1 4 9 12 22 32 1 4 9 12 22 32 1 4 9

For an n by n square matrix A = (a_{ij}), the terms a_{11}, a_{22}, ..., _{nn} are the diagonal entries of the matrix. A is a diagonal matrix if all the off-diagonal entries are zero. In other words, a_{ij} = 0 for i >< j. The following are all the 2 by 2 and 3 by 3 diagonal matrices.