使用Matlab查找矩阵的相关行/列? [英] Find dependent rows/columns of a matrix using Matlab?
问题描述
我有一组线性方程需要使用\
求解,即F=JT\RH
,其中RH是18x1,JT是18x17,F(未知)是17x1,但是matlab给出警告:等级不足和等级是16.所以我想知道哪些列/行是线性相关的.我怎样才能做到这一点?
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?
推荐答案
A的列与线性相关,前提是 null(A)不为零. 在Matlab中运行 B = null(A)将为您返回空空间的基础.对于B中的每一列,取该列中非零元素的索引.这些将是您要查找的列号. 例如,尝试:
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)
这篇关于使用Matlab查找矩阵的相关行/列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!