フィルターのクリア

How to know the bin ranges of a histogram

2 ビュー (過去 30 日間)
Yeping Sun
Yeping Sun 2016 年 9 月 19 日
コメント済み: Walter Roberson 2016 年 9 月 19 日
Dear all,
I have a 2D coordinates files (PC1-PC2.txt, attached) in which each row contains two values and corresponds to a point in space.
by using:
D=dlmread('PC1-PC2.txt');
counts=hist3(D,[40,40]);
I can get a 40 by 40 matrix in which each element represents the number of the original values in the 2-column matrix D falling into the corresponding bin of the histogram.However, how could I get the exact ranges of each bin of the histogram?
And then I wish to figure out which of the histogram (counts) bins each point (each line) in the matrix D falls into. How should I do that?
Best regards.
Yeping Sun

採用された回答

Walter Roberson
Walter Roberson 2016 年 9 月 19 日
[counts, bincenters] = hist3(D,[40,40]);
"[N,C] = hist3(X,...) returns the positions of the bin centers in a 1-by-2 cell array of numeric vectors"
  2 件のコメント
Yeping Sun
Yeping Sun 2016 年 9 月 19 日
編集済み: Walter Roberson 2016 年 9 月 19 日
Thank you! By using:
[counts, bincenters] = hist3(D,[40,40]);
I get:
bincenters =
[1x40 double] [1x40 double]
But how to show these numbers of the bincenters?
Walter Roberson
Walter Roberson 2016 年 9 月 19 日
disp('bin x')
bincenters{1}
disp('bin y')
bincenters{2}

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by