Function inverse

inverse(A) takes a $2 \times 2$, $3 \times 3$, or $4 \times 4$ matrix $A$, and returns its inverse $A^{-1}$. If the matrix is not invertible, the result may be numerically invalid (with INF or NaN entries).