I am trying to find the column space of a matrix
Show older comments
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
Answers (1)
ProblemSolver
on 13 Jul 2023
4 Comments
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]
rrefA = rref(A)
pivotColumns = find(any(rrefA, 1))
basisColumnSpace = A(:,pivotColumns)
Walter Roberson
on 7 Nov 2024
This does not work FYI. It does not properly find the column space vector (try with A = [1,3,2;0,1,0])
Walter Roberson
on 7 Nov 2024
I believe that @Torsten is providing a counter-example to illustrate the failure of @ProblemSolver approach. I do not believe that Torsten is attempting to illustrate a correct general method.
Carter
on 7 Nov 2024
That would make sense, thank you for the clarification.
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!