cross

Cross products

C = cross(A, B)

• A and B should be arrays of any number of dimensions.
• If A and B are vectors, they both should have exactly 3 elements. C is the cross product of A and B.
• If A and B are matrices or arrays having more dimensions, they should have the same sizes, and the first non-singleton dimension should have length 3. C contains cross products of vectors of A and B along the first non-singleton dimension.

C = cross(A, B, dim)

• Same as C = cross(A,B), except that cross products are computed from vectors of A and B taken from the dim-th dimension, and that the dim-th dimensions of A and B should have exactly 3 elements.