Linear Equations -- JHU MATLAB Help Page
LINEAR EQUATIONS
Creating a Matrix
Substituting Within a Symbolic Matrix
Manipulating Regular Matrices
Vectors
Scalar Multiplication
Addition of Matrices
Gauss-Jordan Elimination
Reduced Row-Echelon Form
Dot Product
Rank
Number of Solutions
Rank
How to
Examples
Exercise
How to:
A matrix's rank is the number of leading 1's when we put that matrix into
RREF
. To find a matrix's rank, we could, of course, put that matrix into
RREF
and count the 1's ourselves. But, suppose our matrix is very large, 100x100 maybe. That could be a lot of 1's to count. Maybe, we don't even want to put our matrix into
RREF
, we simply just want to know its rank.
To find a matrix's rank (a non-negative integer value), and store it into a variable (in this case, we'll store it in 'r'):
r = rank(A)
It's that simple.
Examples:
Let's start with our old buddy,
R = [2 4 4; 1 2 9; 2 4 15]
. We know from the last two sections, that when R is in
RREF
, it has a leading '1' in the 1st and 2nd row, but we can find that the easier way:
r = rank(R)
Exercise