how to count the number of scatter points in a each sector region of the 6 concentric circles ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ejjagiri
am 5 Dez. 2022
Bearbeitet: Image Analyst
am 5 Dez. 2022
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).
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 5 Dez. 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)
2 Kommentare
Image Analyst
am 5 Dez. 2022
Bearbeitet: Image Analyst
am 5 Dez. 2022
What does each row and column represent? For example if column 1 is x and column 2 is y, what do the other 199 columns represent?
Attach your matrix with the paperclip icon.
So do you want a count for each radius range and each of 4 angle sectors. Then you need to compute the radius of each point.
radii = sqrt(x.^2 + y.^2);
and compute edges for the angles and radii and then use
help histogram2
Weitere Antworten (1)
KSSV
am 5 Dez. 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
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!