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

2 ビュー (過去 30 日間)
Itzik Ben Shabat
Itzik Ben Shabat 2016 年 9 月 7 日
コメント済み: Jesse Ivers 2023 年 10 月 12 日
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
  3 件のコメント
Mikk Laanes
Mikk Laanes 2020 年 10 月 27 日
Could you share how you made the referenced code to work in 3D? It appears to only accept M-by-N matrices?
Jesse Ivers
Jesse Ivers 2023 年 10 月 12 日
@Mikk Laanes It is set up so that you have M data points from each dimension and N dimensions. Each column (1:N) will be considered as a seperate vector of data, so if you have 50 3D data points, you will have 3 columns with 50 values each. Your input will never be greater than 2D, but it can represent ND data by simply increasing columns. Hope this helps.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by