Cross product in Simulink

4 Ansichten (letzte 30 Tage)
Ram
Ram am 29 Jun. 2013
Hi
I am looking to evaluate the cross product of vectors that exist in 2 nx3 matrices in simulink.
My inputs are two matrices A - nx3 and B - nx3.
My output C is such that C(i,:) = cross(A(i,:),B(i,:)). i=1,2,3,....,n.
n is unknown as A and B are variable-sized signals.
Is there a way in which this can be implemented in Simulink without resorting to MATLAB functions.
Thanks,
Ram.
  1 Kommentar
Roger Stafford
Roger Stafford am 29 Jun. 2013
I corrected the sign in my answer. Sorry.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Roger Stafford
Roger Stafford am 29 Jun. 2013
Bearbeitet: Roger Stafford am 29 Jun. 2013
Can you do this in Simulink:
t1 = [2,3,1];
t2 = [3,1,2];
C = A(:,t1).*B(:,t2)-A(:,t2).*B(:,t1);
If so, that will give you the cross product of A and B at each row.
(Corrected the sign. It should be minus.)
  1 Kommentar
Ram
Ram am 29 Jun. 2013
Thanks. It works really well.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by