I have a large amount of data. I have implemented k-means clustering on my data. It clustered the data and plot the graph having data points around centroid in the cluster.
The graph is the following:
But I want to get the exact x
and y
coordinates of the centroid printed so that I can calculate the distance of any new data point from the centroids so as to find out the cluster to which new data will belong.
[ids ctrs]=kmeans(A,19) D = dist([testpoint;ctrs]) %testpoint is 1x10 and D will be 20x20 [distance testpointID] = min(D(1,2:end)) I am not able to understand what [distance testpointID] = min(D(1,2:end)) actually does??Please help me!!!