Assign points to a mean?

1 次查看(过去 30 天)
Julozert
Julozert 2020-5-11
Hi guys,
im currently trying to write my own code for a Lloyd Algorithm to make a custom kmeans function. But I really struggle how I can assign my sample points to my mean points.
Anyone knows how I can assign the random samples to their clostest point?

回答(1 个)

Image Analyst
Image Analyst 2020-5-11
You can use randperm() or randsample() to get a list of random indexes. Then just call mean().

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by