You can use the dot product formula to calculate the angle between two vectors in Matlab. The dot product is defined as the product of the magnitudes of the two vectors and the cosine of the angle between them.
Here is an example code that calculates the angle between two vectors in degree:
main.m395 chars19 lines
Output:
main.m53 chars2 lines
gistlibby LogSnag