Filter löschen
Filter löschen

how to get cross product of two vectors?

7 Ansichten (letzte 30 Tage)
MOHD
MOHD am 5 Okt. 2012
hi, I have problem to find out crossproduct of two vectors(AXB), where each component of vector represent 4X4 matrix
example:
A=[A1 A2 A3]; B=[B1 B2 B3];
where A1 A2 A3,B1 B2 B3 represents 4X4 matrix
thanks in advance

Antworten (1)

Andrei Bobrov
Andrei Bobrov am 5 Okt. 2012
Bearbeitet: Andrei Bobrov am 5 Okt. 2012
A = randi(18,4,4,3);
B = randi(10,4,4,3); %The initial arrays with size (4x4x3)
out1 = cellfun(@(x,y)cross(x,y),num2cell(reshape(A,[],3),2),num2cell(reshape(B,[],3),2),'un',0);
out = reshape(cat(1,out1{:}),size(A));

Kategorien

Mehr zu Operators and Elementary Operations 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