how to count the number of scatter points in a each sector region of the 6 concentric circles ?
10 views (last 30 days)
I have found the scatter points in a graph but i need to find the number of scatter points lies inside of the sector region of the circle in the form of percentage ? i have attached the sample answer graph for this question(fig2).
Image Analyst on 5 Dec 2022
If you have the x and y points then you can get the angle of each point using atand
angles = atand(y ./ x)
Then you can take the histogram
counts = histcounts(angles, 8)
percents = 100 * counts / numel(x)
More Answers (1)
KSSV on 5 Dec 2022
Let (x,y) be your scattered points.
C = [mean(x) mean(y)] ; % center of circle. This would be (0,0)
R = 200 ; % RAdius of circle
d = sqrt((C(1)-x).^2+(C(2)-y).^2) ; % distance of each point from circle center
idx = d <= R ; % points lying inside circle of radii R
nR = nnz(idx)*100/length(x) % percentage of points lying inside circle of radius R