MATLAB: I need to know each point to which cluster in kmeans fun.

kmeans

hi, i used this function kmeans, and take simple example
x=[100 2 4 10 200; 50 100 20 1 5];
[p o]=kmeans(x,2)
what i got:
p =
1
2
o =
100 2 4 10 200
50 100 20 1 5
what i need is know each point for which cluster belong, what the code do is just get the two clusters i gave it and the points that i gave it.
how I know the clusters that each point belong to?
thanks

Best Answer

Huda, you gave kmeans two points and asked it to cluster them into two clusters. It has assigned the first point to cluster 1, whose centroid is at the first point, and similarly for the second point. Presumably that is not very informative.
I don't know what your data mean, or whether kmeans makes sense, but your description sounds like something more suited to distance-based methods such as hierarchical clustering or multidimensional scaling, both of which are available in the Statistics Toolbox. You would, of course, have to convert your similarities to dissimilarities.