function c=cosangle(x,y) % the cosine of the angle between row vectors x and y c=(x*y')/(norm(x)*norm(y));