Section 4.5 Inverse of a Matrix, Identity Matrix
Given a square matrix A, the matrix B is the inverse of A if it satisfies the following equation:
\begin{equation*}
AB = BA = I
\end{equation*}
where \(I\) is the identity matrix.
The inverse of a matrix A is denoted \(A^{-1}\text{.}\) With the above definition we therefore have
\begin{equation*}
AA^{-1} = A^{-1}A = I
\end{equation*}
In MATLAB there are several ways to find the matrix inverse. One of these is to simply write A^(-1) as you can see in the following example:
>> A = [8 5 3; 1 2 5; 2 9 4]; %3x3 matrix >> AI = A^(-1) %() are optional here
AI = 0.1474 -0.0279 -0.0757 -0.0239 -0.1036 0.1474 -0.0199 0.2470 -0.0438
There is also an inverse function,
inv()
that returns the inverse of a matrix as well:>> A = [8 5 3; 1 2 5; 2 9 4]; %3x3 matrix >> AI = inv(A) %() are optional here
AI = 0.1474 -0.0279 -0.0757 -0.0239 -0.1036 0.1474 -0.0199 0.2470 -0.0438
We can check that
inv()
did indeed provide the inverse by checking whether \(A*AI\) returns the identity matrix:>> A * AI
ans =
1.0000 0 -0.0000
0.0000 1.0000 0
0.0000 0.0000 1.0000
It does! Note that there is simply round-off error present, resulting in the decimal notation.