why is the rank of a matrix is different from the rank of its Reduced Row Echelon Form

4 views (last 30 days)

Accepted Answer

Matt J
Matt J on 22 Apr 2022
Edited: Matt J on 22 Apr 2022
Generally speaking it is because doing rref introduces floating point errors that perturb the SVD, from which the rank is calculated. Also, when calling rank(), you have used the default numerical tolerance parameter. If you use a different tolerance,
load('workspace_data_file','Cir_A')
rank(Cir_A,1e-8)
ans = 4
you get a different result. So, the comparison is a bit arbitrary.
  2 Comments
Zaiping Zhu
Zaiping Zhu on 22 Apr 2022
generally, what should I use to determine the rank of a matrix, rank(A) or rank(rref(A)).
Here is the context, I am calculating the solution to the equation Ax=b, but matrix A is singular, so I have to remove the free variables columns from A to get A_new. Then, A_new'A_new is an invertible matrix, which can be used to find the approximate solution to Ax = b. So the key is find out the free variables columns in A. But the rank result is different based on our choose between rank(A), rank(A, tolerance) rank(rref(A)). What I am supposed to use for my probelm.
Matt J
Matt J on 22 Apr 2022
Edited: Matt J on 22 Apr 2022
That sounds equivalent to doing x=pinv(A)*b.
rref is not recommended for pretty much anything. From the doc for rref():

Sign in to comment.

More Answers (0)

Categories

Find more on Linear Algebra in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!