# 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.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

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.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## 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

Web Server: Not supported in VIs that run in a web application