I want to find the index of all linear columns in matrix. The output is a vector in which gives 1 for independent columns and -1 for all linear dependency columns. For example, I have a matrix A that is
A =
1 0 0 0 0 1 1
1 0 0 1 0 1 1
1 1 1 0 1 1 1
1 1 1 0 1 1 0
We can see that column dependency are 1,2,3,5,6. Hence my expected result are
output=[-1 -1 -1 1 -1 -1 1];
And the independent matrix remains
A =
0 1
1 1
0 1
0 0
How to implement it by matlab ? How about with linear rows?