# I am trying to find the column space of a matrix

72 vues (au cours des 30 derniers jours)
Taylor le 13 Juil 2023
Commenté : Torsten le 13 Juil 2023
I am working on a lab for my class and am having issues finding the column soace for the matrix.
A = [1,1,0,2,0;0,1,1,3,0;2,0,0,0,1;3,1,0,2,1;2,1,1,3,0;1,0,0,2,1]
This is the matrix that I am using. Tried the code
rrefA = rref(A)
pivotColumns = rrefA(:,1:end-1)
basisColumnSpace = A(:,pivotColumns)
but i cant get it to work I keep getting a error that i cant clear. I am wondering if there is another way to find the column space with the basic MatLab package. I would apperciate any help.
Thank You
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (1)

ProblemSolver le 13 Juil 2023
@Taylor -- You just need to use this:
pivotColumns = find(any(rrefA, 1));
I hope this works!
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Torsten le 13 Juil 2023
Counterexample:
A = [1,1,0,2,4;0,1,1,3,6;2,0,0,4,8;3,1,0,5,10;2,1,1,6,12;1,0,0,7,14]
A = 6×5
1 1 0 2 4 0 1 1 3 6 2 0 0 4 8 3 1 0 5 10 2 1 1 6 12 1 0 0 7 14
rrefA = rref(A)
rrefA = 6×5
1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0
pivotColumns = find(any(rrefA, 1))
pivotColumns = 1×5
1 2 3 4 5
basisColumnSpace = A(:,pivotColumns)
basisColumnSpace = 6×5
1 1 0 2 4 0 1 1 3 6 2 0 0 4 8 3 1 0 5 10 2 1 1 6 12 1 0 0 7 14

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Preprocessing Data 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