how to obtain the basis vector of the space orthogonal to K vectors?

8 ビュー (過去 30 日間)
Syam MS
Syam MS 2020 年 7 月 20 日
コメント済み: John D'Errico 2020 年 7 月 21 日
Hi,
I have Psi= [e1; e2; ... eK; ] having K (eigen vectors) rows, and need to find (N-K) basis vectors of the space orthogonal to K vectors. So that resultant, Psi_new= [e1; e2; ... eK; e(K+1); ... eN; ].
If K=4 and N=6. Then, for any e=[0.9999; 0.8294; 1.0173; 0.9973]; Psi=[e']; Further, I have to find (6-4=2) basis vectors.
basis=null(Psi(:).') result as
basis =
-0.4302 0.8781 -0.1495 -0.1465
-0.5276 -0.1495 0.8167 -0.1797
-0.5173 -0.1465 -0.1797 0.8238
which is not the required one. So, could anyone tell me what commands in matlab is useful to obtain the (N-K) basis vector of the space orthogonal to K vectors?

採用された回答

John D'Errico
John D'Errico 2020 年 7 月 20 日
null is the tool to do exactly that.
  2 件のコメント
Syam MS
Syam MS 2020 年 7 月 21 日
So does that mean I just need to choose 2 elements from the 3x4 basis matrix ?
John D'Errico
John D'Errico 2020 年 7 月 21 日
NO. You need to use the function null. Read the help for null. Look at the examples. TRY IT.
For example, Consider the vectors in B.
B = rand(3,5)
B =
0.8892 0.7917 0.46752 0.91457 0.3652
0.66566 0.90643 0.91953 0.93016 0.78042
0.96681 0.068954 0.96643 0.86964 0.22151
They can be viewed as independent vectors spanning some 3-dimensional subspace of R^5. While they are not orthogonal, they could eaily be made so, using for example, a Gram-Schmidt orthogonalization. Or you could use just orth.
Since here we have a 5 dimensional space, and 3 vectors spanning some 3 dimensional subspace, then there is a subspace of dimension 5-2 that is orthogonal to this subspace. null provides us a basis for the nullspace.
N = null(B)
N =
-0.53286 0.25093
-0.19447 -0.43255
-0.15403 -0.44708
0.80335 0.063967
-0.09563 0.73889
>> B*N
ans =
-9.0206e-17 1.1102e-16
1.9429e-16 -1.1102e-16
9.3675e-17 1.6653e-16
As you see, to within floating point trash, they are orthogonal to the original set, and they form an orthogonal basis, again, to within floating point trash.
N'*N
ans =
1 -6.8656e-18
-6.8656e-18 1
Read the help for null. Look at the examples.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by