Counting the number of data points inside grid
3 次查看(过去 30 天)
显示 更早的评论
I need help with counting and updating the number of unlabelled data points inside each 2d grid after plotting the points randomly.
0 个评论
回答(1 个)
Image Analyst
2012-5-12
Well, you plotted them so why don't you know the lengths of the arrays, or how many points you plotted?
2 个评论
Don
2023-9-6
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
2023-9-6
@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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!