# Inverse Matrix (G Dataflow)

Finds the inverse of an input matrix, if the inverse exists.

## matrix type

Type of the input matrix.

Specifying the matrix type allows this node to execute more quickly by avoiding unnecessary computations, which could introduce numerical inaccuracy.

Name Description
General

The input matrix is a matrix that you cannot describe with one of the other categories.

Positive definite

The input matrix is positive-definite.

Lower triangular

The input matrix is lower triangular.

Upper triangular

The input matrix is upper triangular.

Default: General

## matrix

A square matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

If the matrix is singular or is not square, this node returns an empty array and an error.

## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

## inverse matrix

The inverse matrix of the input matrix.

## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Calculating the Inverse Matrix

If the input matrix is nonsingular, this node calculates the output inverse matrix by solving the linear system given by the following equation.

AB = I

where

• A is the input matrix
• B is the output inverse matrix
• I is the identity matrix

If A is a nonsingular matrix, you can show that the solution to the preceding system is unique and that it corresponds to the output inverse matrix of A, given by the following equation.

B = A-1

Therefore, B is an inverse matrix.

Note

The numerical implementation of the matrix inversion is not only numerically intensive, but because of its recursive nature, is also highly sensitive to round-off errors introduced by the floating-point numeric coprocessor. Although the computations use the maximum possible accuracy, this node cannot always solve for the system.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported