Mathematics |
If A is square and nonsingular, the equations AX = I and XA = I have the same solution, X. This solution is called the inverse of A, is denoted by A-1, and is computed by the function inv
. The determinant of a matrix is useful in theoretical considerations and some types of symbolic computation, but its scaling and roundoff error properties make it far less satisfactory for numeric computation. Nevertheless, the function det
computes the determinant of a square matrix.
Again, because A
is symmetric, has integer elements, and has determinant equal to one, so does its inverse. On the other hand,
B = magic(3) B = 8 1 6 3 5 7 4 9 2 d = det(B) X = inv(B) d = -360 X = 0.1472 -0.1444 0.0639 -0.0611 0.0222 0.1056 -0.0194 0.1889 -0.1028
Closer examination of the elements of X
, or use of format rat
, would reveal that they are integers divided by 360.
If A
is square and nonsingular, then without roundoff error, X = inv(A)*B
would theoretically be the same as X = A\B
and Y = B*inv(A)
would theoretically be the same as Y = B/A
. But the computations involving the backslash and slash operators are preferable because they require less computer time, less memory, and have better error detection properties.
Inverses and Determinants | Pseudoinverses |