cross product of by an array

13 vues (au cours des 30 derniers jours)
Oday Shahadh
Oday Shahadh le 11 Juin 2020
Commenté : Oday Shahadh le 11 Juin 2020
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

Réponses (1)

Todd
Todd le 11 Juin 2020
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 commentaire
Oday Shahadh
Oday Shahadh le 11 Juin 2020
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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by