Center of mass or clusters

3 次查看(过去 30 天)
steve Brian
steve Brian 2020-4-11
Hi there!
If I have an NxM matrix and a number of clusters, how do I return a centroids point vector representing the averages (centers of mass) of the clusters?

回答(1 个)

Image Analyst
Image Analyst 2020-4-11
It's returned by the kmeans() function as the second output argument:
[indexes, clusterCentroids] = kmeans(data, numberOfClusters);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by