Which columns are linearly independent in a matrix?

9 vues (au cours des 30 derniers jours)
juan
juan le 10 Sep 2011
Modifié(e) : Dave Stanley le 24 Août 2017
Hi everybody:
I need to know what columns of a matrix are linearly independent.
Someone says that the "rref" command can do this, but I cannot get it, because I know that this command only give me a reduced form of an Echelon matrix.
What I need is the index of the columns of a matrix that are linearly independent. Can someone give me a help?
Thanks in advance.

Réponses (2)

Andrei Bobrov
Andrei Bobrov le 10 Sep 2011
[i1 j1] = find(triu(squeeze(all(abs(diff(bsxfun(@rdivide,A,permute(A,[1 3 2]))))<1000*eps)),1));
indclm = find(~ismember(1:size(A,1),unique([i1; j1])));
variant 2
ic = nchoosek(1:size(A,2),2)
indclm = find(~ismember(1:size(A,1),unique(ic(all(abs(diff(A(:,ic(:,1))./A(:,ic(:,2)))) < 100*eps),:))))

Dave Stanley
Dave Stanley le 24 Août 2017
Modifié(e) : Dave Stanley le 24 Août 2017
I wrote a few functions to handle this. They do basically the same as Andrei's solution above, with some added bells and whistles. (Namely, it includes an option for ignoring columns that are shifted by a constant; for example, if col2 = 10 - col1 ). Hope it's useful.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by