필터 지우기
필터 지우기

how to check whether a vector in a subspace or not?

조회 수: 23 (최근 30일)
Daniel Niu
Daniel Niu 2022년 10월 22일
편집: John D'Errico 2022년 10월 22일
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!

채택된 답변

John D'Errico
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]
V = 6×7
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)
ra = 4
So even though V has more columns than rows,
size(V)
ans = 1×2
6 7
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개)

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by