Solving Linear by MATLAB
Solving Linear by MATLAB
Solving linear
system using
MATLAB
Copyright © 2005. The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
A singular problem refers to a set of equations
having either no unique solution or no solution at all.
For example, the set
3x − 4y = 5
6x − 8y = 10
6x – 10y = 2
3x – 4y = 5
3x − 4y = 5
6x − 8y = 3
is singular but has no solution. The graphs of these two
equations are distinct but parallel (see Figure 6.1–2).
Because they do not intersect, no solution exists.
The graphs of two equations that intersect at a solution.
Figure 6.1–1
Parallel graphs indicate that no solution exists.
Figure 6.1–2
Matrix notation enables us to represent multiple equations
as a single matrix equation. For example, consider the
following set:
2x1 + 9x2 = 5
3x1 − 4x2 = 7
This set can be expressed in vector-matrix form as
2 9 x1 5
=
3 −4 x2 7
which can be represented in the following compact form
Ax = b
For the equation set Ax = b,
Matrix A : Row 2 of matrix A is a scalar multiple of row 1; that is, row 2 is equal to
twice row 1. Therefore, rows 1 and 2 are linearly dependent. Matrix A has only
one linearly independent row, so its rank is 1.
Matrix B : All of its rows are linearly independent, so the rank of matrix B is 3
Calculate the Rank in MATLAB
Rank vs Linear system equation
If a linear system of equation with m equation and n
unknowns:
Ax = b
The augmented matrix is formed by concatenating
the vector b onto the matrix A:
[A b]