필터 지우기
필터 지우기

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 CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by