Assign points to a mean?

1 view (last 30 days)
Julozert
Julozert on 11 May 2020
Answered: Image Analyst on 11 May 2020
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?

Answers (1)

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

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!