how to join the centroid to respective cluster points.
Show older comments
I have a data file carrying 30 points x,y coordinates in the manner
1 20 30
2 21 31
3 22 32... so on.
I am using following commands to cluster my data in n groups.

X=load('dabra_village_data.txt');
Y=pdist(X,'euclid');
Z=linkage(Y,'median');
T= cluster(Z,'cutoff',0.9)
x=X(:,2);
y=X(:,3);
indexstring =T(:,1);
gscatter(x,y,T)
Now T has the index of each point to which cluster it belongs to.
c1 matrix carries x y coordinates of centroids of each cluster.
plot(c1(:,1), c1(:,2),'*r')
I want to join these centroid points to their cluster points respectively in the same graph.
Answers (0)
Categories
Find more on Cluster Analysis and Anomaly Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!