cross product of by an array

12 次查看(过去 30 天)
Oday Shahadh
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 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by