フィルターのクリア

Maximum occurrence value of histogram

65 ビュー (過去 30 日間)
Balkar Singh
Balkar Singh 2019 年 6 月 26 日
回答済み: Daniel Poiesz 2022 年 3 月 11 日
I am working on R2019a how to find maximum occurrence value of a histogram.Please help. Thank you

回答 (4 件)

Daniel Poiesz
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
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.
  1 件のコメント
Balkar Singh
Balkar Singh 2019 年 6 月 26 日
Thank you.But sir i am working with the histogram, its my work need. Thank you sir if you can help according to my requirement.

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


Steven Lord
Steven Lord 2019 年 6 月 26 日
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
Edward Li 2021 年 7 月 23 日
Can you explain how to call max with two outputs?

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


Daniel Gutierrez
Daniel Gutierrez 2020 年 2 月 18 日
編集済み: Daniel Gutierrez 2020 年 2 月 18 日
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)
  1 件のコメント
Balkar Singh
Balkar Singh 2020 年 2 月 21 日
Thank you

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

カテゴリ

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