how to check whether a vector in a subspace or not?
48 次查看(过去 30 天)
显示 更早的评论
I want to know how to check a vector in b can be expressed by the basis of a subspace. Or whether the vector in b in the subspace or not?
V=[2 3 1 -3 11 2 5;3 3 2 -3 10 3 9;4 3 0 2 -3 9 4;2 -1 -1 1 -3 2 -1;3 -1 3 0 -4 2 12;1 0 4 3 -13 4 13]
ra=rank(V)
R = rref(V)
b1=[4;4;7;2;-1;0]
b2=[1;2;5;6;8;9;]
b=[b1 b2]
Your help would be highly appreciated!
0 个评论
采纳的回答
John D'Errico
2022-10-22
编辑:John D'Errico
2022-10-22
You want to test if a new vector (not two at a time!) lies in the column space of a matrix V. Here, V is a 6x7 matrix.
V=[2 3 1 -3 11 2 5;3 3 2 -3 10 3 9;4 3 0 2 -3 9 4;2 -1 -1 1 -3 2 -1;3 -1 3 0 -4 2 12;1 0 4 3 -13 4 13]
ra=rank(V)
So even though V has more columns than rows,
size(V)
it only as rank 4. If V were full rank, then ANY new vector must lie in the column space of V. But V has rank only 4, so there is "room".
So append the new vector as a new column of V. IF the rank of the new matrix does not change, then the appended vector was already representable as a linear combination of the columns of V. If the rank changes, then your vector is linearly independent of the columns of V.
Again, you must do this test twice, so once for each vector you wish to test. (Don't keep on appending new vectors to V, so that V is growing in size with each test.)
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!