how to obtain the basis vector of the space orthogonal to K vectors?
4 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
John D'Errico
2020-7-20
null is the tool to do exactly that.
2 个评论
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 Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!