How can I find the percentage of the overlap of two histograms in Matlab?
16 ビュー (過去 30 日間)
古いコメントを表示
I try to plot two histograms and I need to know quantitavely what is the area and percentage of overlap of these two histograms.
2 件のコメント
Image Analyst
2013 年 11 月 5 日
Do the bins cover the same ranges? Like they're both 5 units wide and have edges in the same locations?
Filippo
2014 年 11 月 21 日
Assuming they do cover the same ranges... can anyone answer this question? I'm looking too!
回答 (1 件)
Image Analyst
2014 年 11 月 21 日
I'd put each histogram into one row and take the min and the max.
bothHistograms = [hist1; hist2];
minCounts = min(bothHistograms, [], 1);
maxCounts = max(bothHistograms, [], 1);
Then get the ratio of the min value for each bin to the max value for each bin:
ratios = minCounts ./ maxCounts;
If you want the average percentage coverage over all bins, take the mean over all bins:
meanPercentage = mean(ratios);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!