Matrices

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.

A = [a1 a2 . . . ]

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

A = (aij)

denotes a matrix, where aij is the entry at the ith row and jth column (the ij-entry).

Use

Example

The matrix

A = [ 1 2 3 ] 4 5 6

can be considered as three 2-dimensional column vectors

A = [a1 a2 a3], a1 = [ 1 ], a2 = [ 2 ], a3 = [ 3 ] 4 5 6

Example

It can also be considered as two 3-dimensional row vectors. A = [ b1 ], b1 = (1, 2, 3), b2 = (4, 5, 6) b2

For example, for three column matrices A = [a1 a2 a3], B = [b1 b2 b3], we have

A + B = [a1 + b1 a2 + b2 a3 + b3], cA = [ca1 ca2 ca3].

Dialog

Input
Output

Use a comma to separate columns.

Code

The following is the javaScript code.

src/js/matrices.js

Use

Example

(i + j)3*3 = [ 1 + 1 1 + 2 1 + 3 ] = [ 2 3 4 ] 2 + 1 2 + 2 2 + 3 3 4 5 3 + 1 3 + 2 3 + 3 4 5 6 (ij)4*5 = [ 1*1 1*2 1*3 1*4 1*5 ] = [ 1 2 3 4 5 ] 2*1 2*2 2*3 2*4 2*5 2 4 6 8 10 3*1 3*2 3*3 3*4 3*5 3 6 9 12 15 4*1 4*2 4*3 4*4 4*5 4 8 12 16 20 (j2)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 = (aij), the terms a11, a22, ..., nn are the diagonal entries of the matrix. A is a diagonal matrix if all the off-diagonal entries are zero. In other words, aij = 0 for i >< j. The following are all the 2 by 2 and 3 by 3 diagonal matrices.

a 0 0 b
a 0 0 0 b 0 0 0 c