cross product of vectors a and b in matlab

The cross product of vectors a and b can be computed in Matlab using the cross function. Here is an example:

main.m
a = [1 2 3];
b = [4 5 6];

c = cross(a,b);

disp(c);
53 chars
7 lines

Output:

main.m
-3     6    -3
15 chars
2 lines

The resulting vector c is the cross product of a and b.

related categories

gistlibby LogSnag