Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Cross product

`C = cross(A,B)`

`C = cross(A,B,dim)`

`C = cross(`

returns
the cross product of `A,B`

)`A`

and `B`

.

If

`A`

and`B`

are vectors, then they must have a length of 3.If

`A`

and`B`

are matrices or multidimensional arrays, then they must have the same size. In this case, the`cross`

function treats`A`

and`B`

as collections of three-element vectors. The function calculates the cross product of corresponding vectors along the first array dimension whose size equals 3.

Was this topic helpful?