Filter löschen
Filter löschen

Histogram exceeds probability density 1.0

2 Ansichten (letzte 30 Tage)
Dimuthu Dharshana
Dimuthu Dharshana am 30 Okt. 2013
Kommentiert: Walter Roberson am 30 Okt. 2013
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 Kommentare
Image Analyst
Image Analyst am 30 Okt. 2013
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by