Borrar filtros
Borrar filtros

Histogram exceeds probability density 1.0

2 visualizaciones (últimos 30 días)
Dimuthu Dharshana
Dimuthu Dharshana el 30 de Oct. de 2013
Comentada: Walter Roberson el 30 de Oct. de 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 comentarios
Image Analyst
Image Analyst el 30 de Oct. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by