matinv(X)

Returns the inverse of the given matrix. (Available as of prod-9)

Function type

Vector only

Syntax

matinv(X)

Input

Argument Type Description
X matrix model A column name

The column specified by this parameter must contain matrix models generated by the 1010data Matrix Functions.

Return Value

Returns a matrix model that is the inverse of the matrix specified by X. If X is a non-square matrix, the result is a one-sided inverse.

Note: Taking the inverse of a non-invertible matrix will yield a matrix of N/As.

Example

Consider the following example:

<table cols="name, data_1, data_2, data_3, data_4" title="matinv example">
John,8,0,5,1;
John,2,0,1,1;
Mary,3,1,2,2;
Mary,4,1,2,2;
John,5,2,3,1;
John,6,2,3,1;
Mary,7,3,4,2;
Mary,1,3,0,2
</table>
<willbe name="matrix_0" value="g_matrix(name;;;data_1 data_2 data_3 data_4;0)"/>
<willbe name="matrix_0_inv" value="matinv(matrix_0)"/>

The matrix in every row in matrix_0_inv will be the inverse of the matrix in the same row in matrix_0.

For example, clicking on the > character in the first row of the matrix_0 column displays the matrix for those rows where name is John.

Clicking on the > character in the first row of the matrix_0_inv column displays the inverse of that matrix.

Note: Because matrix_0 and matrix_0_inv are square matrices, you can use matmul(X;Y) to multiply them together to get the identity matrix.