Maximum occurrence value of histogram
이전 댓글 표시
I am working on R2019a how to find maximum occurrence value of a histogram.Please help. Thank you
답변 (4개)
Daniel Poiesz
2022년 3월 11일
To find value most likely to occur:
[~, idx] = max(histogram.Values); % tallest bin(y value) and its index location
mostLikely = histogram.BinEdges(idx); % x value associated with greatest y value
KALYAN ACHARJYA
2019년 6월 26일
편집: KALYAN ACHARJYA
2019년 6월 26일
Why you go for histogram? You can get the value from array itself
Maximum occurrence bins in histogram==Maximum occurrence element in data_array
data_array=[]
% This gives the value of repeated elemnets (Maximum occurrence)
data_mode=mode(y);
% Gives repetitions number
count1=sum(data_array(data_array(:)==data_mode))/data_mode
There may be more easier way.
Steven Lord
2019년 6월 26일
0 개 추천
Call max (with two outputs, if you want both the highest bin count and the bin that has that count) on the Values or BinCounts properties of the histogram object, depending if you want to work with normalized or un-normalized data.
댓글 수: 1
Edward Li
2021년 7월 23일
Can you explain how to call max with two outputs?
Daniel Gutierrez
2020년 2월 18일
편집: Daniel Gutierrez
2020년 2월 18일
0 개 추천
If you try to get the value of the bin with the maximum repetitions in the histogram with a pdf function use:
max(histogram.Values)
카테고리
도움말 센터 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!