How to get Bin Edges at specific Value point (Maximum value) in histogram.

조회 수: 7 (최근 30일)
Hi,
I hava a simple query. I just want to know the BinEdges value at specific peak.
So, I am only intrested in the Peak value and its Bin edges values. How I can get this.
H=histogram(Data);
HMAX=max(H.Values,[],"all");
How to get Bin edges at max value point,ie., 164209.
Kindly advise.

채택된 답변

Dyuman Joshi
Dyuman Joshi 2024년 3월 28일
load('Data.mat')
H = histogram(DATA)
H =
Histogram with properties: Data: [640×9615 double] Values: [107571 0 0 0 0 113997 0 0 0 117632 0 0 0 0 0 122485 0 0 0 0 126756 0 0 0 0 129006 0 0 0 0 134149 0 0 0 133991 0 0 0 0 0 135543 0 0 0 0 164209 0 0 0 0 134254 0 … ] (1×165 double) NumBins: 165 BinEdges: [40.6000 40.6200 40.6400 40.6600 40.6800 40.7000 40.7200 40.7400 40.7600 40.7800 40.8000 40.8200 40.8400 40.8600 40.8800 40.9000 40.9200 40.9400 40.9600 40.9800 … ] (1×166 double) BinWidth: 0.0200 BinLimits: [40.6000 43.9000] Normalization: 'count' FaceColor: 'auto' EdgeColor: [0 0 0] Use GET to show all properties
%Get the index of the max value alongside
[HMAX, idx] = max(H.Values,[],"all")
HMAX = 164209
idx = 46
%USe the index to get the corresponding bin edges
H.BinEdges([idx idx+1])
ans = 1×2
41.5000 41.5200
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by