MATLAB Answers

0

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

Asked by Itzik Ben Shabat on 7 Sep 2016
Latest activity Commented on by Itzik Ben Shabat on 7 Sep 2016
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 : https://www.mathworks.com/matlabcentral/fileexchange/23897-n-dimensional-histogram
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

  1 Comment

I changed line 108 in the link to
[~,~, loc(:,d)] = histcounts (Xd, ed);
I think it worked

Sign in to comment.

Tags

0 Answers