Inverse of a matrix
This functionality does not run in MATLAB.
inverse(A) returns the inverse of the matrix A.
If the argument does not evaluate to a matrix of one of the types mentioned above, a symbolic call inverse(A) is returned.
By default, inverse calls normal before returning results. This additional internal call ensures that the final result is normalized. This call can be computationally expensive. It also affects the result returned by inverse only if a matrix contains variables or exact expressions, such as sqrt(5) or sin(PI/7)).
To avoid this additional call, specify Normal = FALSE. In this case, inverse also can return normalized results, but does not guarantee such normalization. See Example 4.
Compute the inverse of a matrix given by various data types:
A := array(1..2, 1..2, [[1, 2], [3, PI]]); inverse(A)
B := hfarray(1..2, 1..2, [[1, 2], [3, PI]]); inverse(B)
C := matrix(2, 2, [[1, 2], [3, PI]]); inverse(C)
delete A, B, C:
The following matrix is not invertible:
inverse(matrix([[1, 2], [3, 6]]))
If the input does not evaluate to a matrix, then symbolic calls are returned:
delete A, B: inverse(A + 2*B)
Using Normal can significantly decrease the performance of inverse. For example, computing the inverse of this matrix takes a long time:
n := 5: inv5 := inverse(matrix(n, n, [[1/(x[i] + x[j]) $ j = 1..n] $ i = 1..n])):
For better performance, specify Normal = FALSE:
n := 5: inv5 := inverse(matrix(n, n, [[1/(x[i] + x[j]) $ j = 1..n] $ i = 1..n]), Normal = FALSE):
Option, specified as Normal = b
Return normalized results. The value b must be TRUE or FALSE. By default, Normal = TRUE, meaning that inverse guarantees normalization of the returned results. Normalizing results can be computationally expensive.
The inverse is returned as a matrix of the same type as the input matrix. If the matrix is not invertible, then FAIL is returned. If the input does not evaluate to a matrix, then a symbolic call of inverse is returned.