# How to get the minimum number of rows that, if removed, reduces the rank.

3 views (last 30 days)
Na on 28 Jun 2020
Commented: Matt J on 29 Jun 2020
I have a matrix A
How can I get the number of rows that make matrix A rank deficient.
for example
A =[ 6.5480 -6.5480 0.0000 -0.0000
6.5480 -6.5480 0.0000 -0.0000
-6.5480 6.5480 -0.0000 0.0000
-0.0000 0.0000 5.8267 -6.0073
-0.0000 0.0000 5.8267 -6.0073
-0.0000 0.0000 -6.1879 6.3685
0 0 1.0000 0
0 0 0 1.0000]
rank_A =rank(A)
The rank of A is 3, if I remove 3 rows, the rank of the matrix changes to 2.
So, the result should be 3 ---> number of rows

Matt J on 28 Jun 2020
Well, if A were full rank, it's rank would be
min(size(A));
So, perhaps you want the difference between this and the actual rank.

Matt J on 28 Jun 2020
I don't know what d or row_of_subset are supposed to signify, but when running my code, you should get,
>> subset{:}
ans =
-15.2586 20.8295 -5.5709 -6.9904 5.9336 -1.4319
-4.0199 -5.3450 9.3648 -1.7655 -2.0406 1.6268
-3.3911 3.3911 0 14.0359 -15.7297 0
6.9904 -8.4331 1.4428 -15.2586 22.7313 -5.5289
1.7655 2.1325 -3.8980 -4.0199 -5.1148 9.6219
0 0 0 0 0 1.0000
Na on 28 Jun 2020
I got this result
subset{:}
ans =
-15.2586 20.8295 -5.5709 -6.9904 5.9336 -1.4319
-4.0199 -5.3450 9.3648 -1.7655 -2.0406 1.6268
6.9904 -8.4331 1.4428 -15.2586 22.7313 -5.5289
1.7655 2.1325 -3.8980 -4.0199 -5.1148 9.6219
0 0 0 0 0 1.0000
ans =
16.4375 -16.4375 0 6.6072 -3.2451 0
4.3822 0 -4.3822 1.7820 0 -0.2678
0 -1.4428 1.4428 0 5.4882 -5.5289
-3.6609 3.3911 0.2698 18.0744 -15.7297 -4.3492
0 0 0 1.0000 0 0
Matt J on 29 Jun 2020
That's quite possible. I don't have your exact A matrix, so my output can be different from yours. Either way, the code appears to be working.