How can I find the center of random coordinates?
8 views (last 30 days)
Show older comments
If I have 100 points distributed randomly, how can I find the center of them?
0 Comments
Accepted Answer
Image Analyst
on 2 Dec 2017
Depends on what you mean by center. It could be the mean:
meanx = mean(x);
meany = mean(y); % Regardless of how big x and y are
OR could be the center between the min and max (average between left most and right most values).
middlex = (min(x) + max(x))/2;
middley = (min(y) + max(y))/2;
2 Comments
Image Analyst
on 2 Dec 2017
Why would neither of the two methods I gave work and you'd want a different one? What is your definition of "center"? Please define EXACTLY what center means to you.
More Answers (1)
Star Strider
on 2 Dec 2017
It depends on what you mean by ‘center’, The centroid of your point cloud is simply the mean of them in every dimension.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!