简体   繁体   中英

Find dependent rows/columns of a matrix using Matlab?

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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM