From: BHARATH on
hi
I need a cosine angle between vectors in the range [0,1]. here my vector is of 20,000 tuples. sholud i need to normalize it?????

i know that theta=acos(dot(a,b))/norm(a)*norm(b)

please tell me .. how to find it....
my aim is to measure the correlation between them...
From: Wayne King on
"BHARATH " <bhushabhusha(a)gmail.com> wrote in message <hlghj2$6ab$1(a)fred.mathworks.com>...
> hi
> I need a cosine angle between vectors in the range [0,1]. here my vector is of 20,000 tuples. sholud i need to normalize it?????
>
> i know that theta=acos(dot(a,b))/norm(a)*norm(b)
>
> please tell me .. how to find it....
> my aim is to measure the correlation between them...

Hi, you need to take the inverse cosine of dot(a,b)/norm(a)*norm(b). The way you have written it, you are taking the inverse cosine of the inner product of the vectors a and b and dividing that by the product of their norms. That is not the definition of theta.

Also, see

>>doc corrcoef

Hope that helps,
Wayne