How can I find the center of random coordinates?

8 views (last 30 days)
If I have 100 points distributed randomly, how can I find the center of them?

Accepted Answer

Image Analyst
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
aksa
aksa on 2 Dec 2017
Dear Sir Thanks very much My problem is that if I have 100 sensor node distributed randomly and I know the contented of them and there are limit radius such as 25M (no sensor placed out side of 25M) should I use the above method or there are any way else
Thanks
Image Analyst
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.

Sign in to comment.

More Answers (1)

Star Strider
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.
  1 Comment
aksa
aksa on 2 Dec 2017
Dear Sir Thank you very much for your answer Is there any algorithm in MATLAB can be use for large scale to find the center Thanks

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!