INVERSE

Purpose:

Computes the inverse of a square matrix.

Syntax:

INVERSE(a)

a

-

A square matrix.

Returns:

A matrix.

Example:

a = {{1, 3, 4},

     {5, 6, 7}, 

     {8, 9, 12}} 

 

b = inverse(a)

 

b == {{-0.6,     0.0,     0.2},

      { 0.26667, 1.3333, -0.8667}, 

      { 0.2,    -1.0,     0.6}} 

 

a *^ b == {{1, 0, 0},

           {0, 1, 0}, 

           {0, 0, 1}} 

 

to within machine precision.

Example:

W1: rand(100)

W2: inv(W1)

W3: W1 *^ W2

 

Remarks:

The inverse b of square matrix a produces a result such that:

 

a *^ b == I, the identity matrix.

 

When a is badly scaled or nearly singular, the inverse cannot be obtained.  See COND to estimate the condition number and RCOND to estimate the reciprocal condition number.

 

When det(a) == 0, the matrix is singular and the inverse cannot be calculated reliably. See DET to compute the determinant.

 

See PINV to compute the pseudo-inverse.

 

See SVD for an alternate computation of the matrix inverse.

 

See \^ (Matrix Solve) to efficiently solve a system of equations using LU or QR decomposition.

 

See LINFIT to fit an arbitrary set of basis functions to a series using the method of least squares.

 

INVERSE can be abbreviated INV.

 

See DADiSP/MatrixXL to significantly optimize INVERSE.

See Also:

*^ (Matrix Multiply)

\^ (Matrix Solve)

COND

DADiSP/MatrixXL

DET

LINFIT

LU

MDIV

MMULT

PINV

QR

RCOND

SVD

TRANSPOSE