C = cross(A,B) returns the cross product of A and B.
If A and B are matrices or multidimensional arrays, ...
the cross product of corresponding vectors along the first array dimension whose size equals 3.
So, all you need to write is
You may be able to help just a tiny fraction by giving it the dimension over which to operate as the third optional parameter which will save the overhead of determining that direction internally.
Of course, the explicit loop above will begin to bog down as N becomes large if you haven't preallocated the output array first--but even with that, undoubtedly the internal function will beat it handily.