필터 지우기
필터 지우기

cross product of by an array

조회 수: 8 (최근 30일)
Oday Shahadh
Oday Shahadh 2020년 6월 11일
댓글: Oday Shahadh 2020년 6월 11일
I have (a )which is an array as below:
a =
a{1} = [185x3 double]
a{2} = [185x3 double]
a{3} = [185x3 double]
a{4} = [185x3 double]
a{5} = [185x3 double]
Also I have (L)which is (5,3) matrix
I need to make cross product as below
(0,0,-2) x a{1} = [185x3 double]
0,0,-1 x a{2} = [185x3 double]
0,0,0) x a{3} = [185x3 double]
0,0,1) x a{4} = [185x3 double]
0,0,2) x a{5} = [185x3 double]
this should result another vectors which I need to quiver3 them
thanks in advance

답변 (1개)

Todd
Todd 2020년 6월 11일
You can represent a cross product as a matrix product
a X b = tilde(a)*b
where tilde(a) is a skew-symmetric matrix defined by
tilde = @(v)[
0 -v(3) v(2)
v(3) 0 -v(1)
-v(2) v(1) 0
];
For example
a = [0;0;-1];
b = [1;2;3];
c = tilde(a)*b
b could be a 3xm matrix of column vectors, in which case tilde(a)*b is a crossed with each column of b.
a = [0;0;-1];
b = rand(3,185);
c = tilde(a)*b
Also note that tilde(a)*b = -tilde(b)*a.
My example assumes column vectors, so you'll have to transpose things to apply it to your data.
  댓글 수: 1
Oday Shahadh
Oday Shahadh 2020년 6월 11일
thanks Todd, sorry I made a mistake in typing my question
the range is from(0,0,-2) to (0,0,2) as seen above

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

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by