Prev: How to add a table in GUI using MATLAB 7.4 (R2007a)
Next: Set up 16 workers on a local machine?
From: Rahul Singhal on 7 May 2010 04:54 I am trying to get the cosine similarity between rows in a matrix containing 1's and 0's. I am using the matlab function : D = pdist(X,'cosine') where X = matrix But when i run the command, it gives the following error: ??? Error using ==> pdist at 174 Some points have small relative magnitudes, making them effectively zero. Either remove those points, or choose a distance other than cosine. So how can i overcome this error. can somebody help me plz.. Thanks Rahul
From: Mongkut Piantanakulchai on 7 May 2010 06:14 I guess the vectors that contain all zeros might cause the problem. This is because the dot product should be divided by the product of matrix norm (magnitude) which will become zero). Division by zero might cause problem in that function. Remove all vectors that contains all zeros may help. If you still need those vectors that contains all zeros then you can choose other similarity measures.
|
Pages: 1 Prev: How to add a table in GUI using MATLAB 7.4 (R2007a) Next: Set up 16 workers on a local machine? |