Azzera filtri
Azzera filtri

Histogram exceeds probability density 1.0

2 visualizzazioni (ultimi 30 giorni)
Dimuthu Dharshana
Dimuthu Dharshana il 30 Ott 2013
Commentato: Walter Roberson il 30 Ott 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 Commenti
Image Analyst
Image Analyst il 30 Ott 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.

Accedi per commentare.

Risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by