Counting the number of data points inside grid
2 views (last 30 days)
Show older comments
I need help with counting and updating the number of unlabelled data points inside each 2d grid after plotting the points randomly.
0 Comments
Answers (1)
Image Analyst
on 12 May 2012
Well, you plotted them so why don't you know the lengths of the arrays, or how many points you plotted?
2 Comments
Don
on 6 Sep 2023
Wow, super unhelpful. Maybe the source of data is from an outside source? A CSV perhaps? Came with same question; reading an unseen file for data, need to know how many data points I have.
Image Analyst
on 6 Sep 2023
@Don I'd have been happy to help more and better if he had given some data, but he didn't and I was not sure how to answer the ambiguous question. If you cam with the same question, I can still answer if I know the data or source of the data. Normally if you read data in from an array you can use numel to see how many data points you have. If you have 2-D data and want to know how much is in some grid over the data that you have defined, you can use histogram2
help histogram2
You can set up the "edges" to define where the gridlines are. If you want more help, attach your data file in a new question.
See Also
Categories
Find more on Histograms 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!