Borrar filtros
Borrar filtros

Which columns are linearly independent in a matrix?

4 visualizaciones (últimos 30 días)
juan
juan el 10 de Sept. de 2011
Editada: Dave Stanley el 24 de Ag. de 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.

Respuestas (2)

Andrei Bobrov
Andrei Bobrov el 10 de Sept. de 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 el 24 de Ag. de 2017
Editada: Dave Stanley el 24 de Ag. de 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.

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by