how to locate/extract users in circle from randomly distributed many points..?
Show older comments
Hi everyone. I have randomly deployed users in a hexagon and circle. The problem i am facing is to locate the users which are in circle, and to find the distance of those users/points from the center of circle. Is there any way that only the users which are in circle can be extracted as shown in figure? Kindly help me with this.

Accepted Answer
More Answers (2)
Walter Roberson
on 28 Aug 2016
0 votes
pdist2() with the second argument being the coordinates of the center of the circle. Any of the points within the cutoff radius are "in" the circle and you will know the distance.
3 Comments
ammara khurshid
on 28 Aug 2016
Walter Roberson
on 28 Aug 2016
The first argument would be the location of the points. You do know the location because you used random distribution to generate the locations.
Your figure does not appear to be attached.
Is your task to figure out which of the already-generated positions are within a particular circle, or is your task to generate positions confined to a particular circle like https://www.mathworks.com/matlabcentral/answers/294-generate-random-points-inside-a-circle
ammara khurshid
on 28 Aug 2016
Image Analyst
on 28 Aug 2016
0 votes
If you have two sets of points, red crosses and blue crosses, and want to find corresponding points, like which point in blue best matches a given point in red, this is not easy, and there may be no unique solution. There are many algorithms and you can search for "point matching algorithm" for articles: https://www.google.com/#q=point+matching+algorithm
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!