My question related to find the nearest point to the centroid of the each cluster?

6 次查看(过去 30 天)
after reducing the pareto set, the centroid of the clusters can be found, after finding the centroid of cluster i need to find nearest point to the centroid in each cluster. how to find nearest point to the centroid of each cluster. please suggest me with any related coding as an example.
  8 个评论
Image Analyst
Image Analyst 2018-5-15
Again, I gave you code. Scroll down the page and look at it. Comment down there if you have questions on it.
Jan
Jan 2018-5-16
@rajesh kumar: You do not provide details, which allow to help you specifically. Please try to be much more clearer.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2018-5-15
For a given centroid, try this:
distances = sqrt((x - xCentroid).^2 + (y - yCentroid).^2);
[minDistance, indexOfMin] = min(distances);
xOfClosest = x(indexOfMin);
yOfClosest = y(indexOfMin);

类别

Help CenterFile Exchange 中查找有关 MATLAB Parallel Server 的更多信息

产品


版本

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by