Matrix Computations, Add, Subtract, etc.

A = X + Y => Set A to X plus Y:

To add two matrices, X and Y must be of the same size, same number of rows and same number of columns, X.m = Y.m and X.n = Y.n. The sum A will also be that size of a matrix with each element of A being the sum of the corresponding elements of X and Y, aij = xij + yij for all ij with 1 <= i <= X.m, 1 <= j <= X.n.

A = X − Y => Set A to X minus Y:

Same as sum except aij = xij − yij.

A = X * Y => Set A to X times Y:

To multiply two matrices, k = X.n must equal Y.m, and the product A will be an X.m by Y.n matrix, aij = xi1*y1j + xi2*y2j + ... + xik*ykj.

If one of X or Y is a scalar and the other is a matrix, this is a scalar multiply. All of the elements of the matrix are multiplied by the scalar.

See: Matrix Multiplication -- From MathWorld

A = X / Y => Set A to X divided by Y:

To divide two matrices, they must be square matrices of the same size and the divisor Y must have a matrix inverse Inv(Y). Then A = X * Inv(Y).

If X is a matrix and Y is a scalar != 0, this is a scalar multiply, A = X * (1/Y). If X is a scalar and Y is a square matrix that has an inverse, this is also a scalar multiply, A = X * Inv(Y).

Return to Matrix and Polynomial Computations
Return to Harry's Home Page

This page accessed times since September 15, 2006.
Page created by:
Changes last made on Monday, 06-Aug-07 20:22:38 PDT