フィルターのクリア

Histogram exceeds probability density 1.0

2 ビュー (過去 30 日間)
Dimuthu Dharshana
Dimuthu Dharshana 2013 年 10 月 30 日
コメント済み: Walter Roberson 2013 年 10 月 30 日
Hi, Thank you very much. I tried in that way. However the probability exceeds 1.0 in histogram. I can't find how to fit it.
clear all; close all; DA = xlsread('exceltomatlab.xls','Sheet1', 'B2:B2290'); muDA = mean(DA); stdDA = std(DA); binStep=0.1; binCenters = 0.05:binStep:0.95; % Compute the histogram scaling factor. (If all histogram counts are in a % single bin, the probability = 1) binCount = histc(DA,binCenters); probScale = sum(binCount)*binStep; % Plot the normalized histogram and change the bar color for line % visibility histHandle = bar(binCenters,binCount/probScale,'hist'); set(histHandle,'FaceColor',[0.5,0.5,0.5]); hold on; % Overlay the distribution fit on the histogram x = binCenters; y = normpdf(x,muDA,stdDA); plot(x,y); xlabel('Data'); ylabel('Probability');
I hv attached the excel file as well.
  2 件のコメント
Image Analyst
Image Analyst 2013 年 10 月 30 日
Please add your comment to the original post. Don't forget to attach your file there as well. No one should respond to this one.
Walter Roberson
Walter Roberson 2013 年 10 月 30 日

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

回答 (0 件)

カテゴリ

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