inv
Matrix inverse.
Syntax
Section titled “Syntax”Y = inv(X)Description
Section titled “Description”Returns the inverse of the square matrix X. X must be square and non-singular; numerically singular inputs return an Inf-filled result and trigger a warning.
For solving the linear system A*X = B, prefer linsolve or the \ operator over inv(A)*B — they are faster and more numerically accurate.
Examples
Section titled “Examples”A = [1 2; 3 4];B = inv(A) % [-2 1; 1.5 -0.5]A * B % I (within eps)