EXAMPLE B.7 Using Cramer's Rule to Solve a System of Equations
β Back to LINEAR SYSTEMS AND SIGNALS Overview
EXAMPLE B.7 Using Cramerβs Rule to Solve a System of Equations
Use Cramerβs rule to solve the following simultaneous linear equations in three unknowns:
In matrix form, these equations can be expressed as
| β‘ 2 | 1 | β€ 1 | β‘ x1 | β€ | β‘ β€ 3 |
|---|---|---|---|---|---|
| 1 β£ | 3 | β1 β¦ | x2 β£ | β¦ = | 7 β£ β¦ |
| 1 | 1 | 1 | x3 | 1 |
Here,
Since |A| = 4 = 0, a unique solution exists for x1, x2, and x3. This solution is provided by Cramerβs rule [Eq. (B.21)] as follows:
MATLAB is well suited to compute Cramerβs formula, so these results are easy to verify. To provide an example, let us verify that x1 = 2 using MATLABβs det command to compute the needed matrix determinants.
>> x1 = det([3 1 1;7 3 -1;1 1 1])/det([2 1 1;1 3 -1;1 1 1]) x1 = 2.0000