Find dependent rows/columns of a matrix using Matl

2019-02-26 00:15发布

问题:

I have a set of linear equation to be solved using \ that is F=JT\RH where RH is 18x1 and JT is 18x17 and F (unknown) is 17x1, but matlab gives the warning that rank is deficient and the rank is 16. So I want to know which columns/rows are linearly dependent. How can I do this?

回答1:

Columns of A are linearly dependent iff null(A) is not zero. Running B=null(A) in Matlab will return you a basis of the null space. For every column in B, take the indices of the non-zero elements in that column. These will be the columns numbers you are looking for. For example, try:

a = rand(18,16);
a(:,17) = a(:,2) + a(:,4);
null(a)