How do i write a code which can calculate the cross production of two vectors?

조회 수: 2 (최근 30일)
yang-En Hsiao
yang-En Hsiao 2019년 9월 24일
편집: Bruno Luong 2019년 9월 24일
How do i write a code which can calculate the cross production of two vector ? Both of these two vectors are 1 by 5 vector
At first, i write the code like
a=randn(1,5);
b=randn(1,5);
cross_c=cross(a,b)
or
a=randn(1,5);
b=randn(1,5);
cross_c=cross(a,b,5)
But the window always show me
A and B must be of length 3 in the
dimension in which the cross
product is taken.
How do i write a code which can calculate the cross production of these two 1 by 5 vectors?
  댓글 수: 2
James Tursa
James Tursa 2019년 9월 24일
Cross products are defined for 3-element vectors only. Maybe you could tell us what your definition of this for 5-element vectors would be. What are you using this for?
yang-En Hsiao
yang-En Hsiao 2019년 9월 24일
In fact,the 1 by 5 vectors are the null space for two the MIMO channel,5 by 3 matrix H_A and H_B,and assume they have two null space basis
[uA,sA,vA]=svd(H_A),so uA is a 5 by 5 matrix,and "a" is the sum of two null space vector,which is 1 by 5 vector.
[uB,sB,vB]=svd(H_B),so uB is a 5 by 5 matrix,and "b" is the sum of two null space vector,which is 1 by 5 vector.
Now i want to find an vector which is orthogonal to "a" and "b" ,that is why i want to calculate the cross product between "a" and "b"

댓글을 달려면 로그인하십시오.

답변 (1개)

Bruno Luong
Bruno Luong 2019년 9월 24일
편집: Bruno Luong 2019년 9월 24일
If A and B are 5 x 1
null([a;b])
returns a (5 x 3), 3 vectors in R^5 basis of NULL(SPAN(a,b))

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by