How to count number of points in a volumetric grid (4D histogram)?

11 views (last 30 days)
Hi, I have 3D point data in XYZ and i wish to creat a 4D histogram, i.e. a 3D matrix containing the point count in a volumetric lattice. now, i know how to do it using a ton of for loops but the question is what is th good implementation for this ? btw i found this :
However it uses histc (which i saw is not recommended) and it gives me a strange result (for some unkown reason it adds a bin in one of the dimensions) Thanks, Itzik
Mikk Laanes
Mikk Laanes on 27 Oct 2020
Could you share how you made the referenced code to work in 3D? It appears to only accept M-by-N matrices?

Sign in to comment.

Answers (0)


Find more on Data Distribution Plots 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!

Translated by