fitdist() how to return sigma value?

8 visualizaciones (últimos 30 días)
Lena
Lena el 23 de Jun. de 2014
Comentada: Star Strider el 24 de Jun. de 2014
I want to be able to calculate the FWHM for purposes of energy and timing resolution in my data fitting... how do I pull the sigma value from the pdf that is returned using fitdist()?
h=hist(timingdat,100);
hist(timingdat,100)
xlabel('\Deltat (ns)');
ylabel('Counts');
grid();
histfit(timingdat,100);
pd=fitdist(timingdat(:),'normal')
x=0:0.01:200;
PDF=pdf(pd,x); %PDF is a vector of y values: it's our fit
PDF=PDF/max(PDF); %nor
y=max(h)-10;
PDF=PDF*y;
FWHM = sigma*2*(2*log(2))^(1/2)
hold on
str2=sprintf('%d counts, FWHM = ',countspeak2,FWHM);
title(str2)

Respuesta aceptada

Star Strider
Star Strider el 24 de Jun. de 2014
If you ask it nicely it is more than happy to tell you:
timingdat = 10 + 5*randn(25,1); % Create Data
pd=fitdist(timingdat(:),'normal')
sigma = pd.sigma
produces:
sigma =
4.7014e+000
  2 comentarios
Lena
Lena el 24 de Jun. de 2014
Excellent! Thank you.
Star Strider
Star Strider el 24 de Jun. de 2014
My pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by