Plotted a 3D distribution of points in XYZ plane, I see that some points are grouped together in denser regions...

4 views (last 30 days)
Is there a way to divide the axes into small box volumes, count the number of points in each little box volume, and hence determine the density of each box region via how many points are actually in the box?
Thanks I am very new to matlab and trying to identify dense spots in my plotted data.

Answers (2)

Image Analyst
Image Analyst on 5 Feb 2016
Edited: Image Analyst on 5 Feb 2016
Can you extract this tilted "XYZ Plane" into a normal, regular 2-D array? Is so, you can use blockproc() or hist3(). I believe you can even use blockproc() on a 3-D volume, which I guess would contain the plane of points you mentioned.
For a more continuous count (the summing box moves over by one voxel instead of in "jumps" of a box width), you can use conv2() for 2-D, or convn() to do 3-D.

the cyclist
the cyclist on 5 Feb 2016
Edited: the cyclist on 5 Feb 2016
Use the histcn function from the MATLAB File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!