How can i count the number of point in each grid?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a randomly generated scatter of 5000 points and I have laid a ring grid over the scatter plot.
Could somebody help me in calculating the number of points in the grid.
I did try to use histcounts2 but that was not giving me the correct answer.
Attached is a sample image in which I am trying to find the number of points in each grid.
0 Commenti
Risposte (1)
KSSV
il 21 Gen 2021
Get each box coordinates, this box is a polygon and then use the function inpolygon. Run a loop for each box.
2 Commenti
KSSV
il 22 Gen 2021
Won't you think if you know whether points are inside the polygon, you can count the points? Inpolygon gives you the indices of points lying inside the polygon you can count the indices and the count says how many points are they.
Vedere anche
Categorie
Scopri di più su Scatter Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!