cross product of by an array

13 ビュー (過去 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 Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by