fitdist() how to return sigma value?

9 vues (au cours des 30 derniers jours)
Lena
Lena le 23 Juin 2014
Commenté : Star Strider le 24 Juin 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)

Réponse acceptée

Star Strider
Star Strider le 24 Juin 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 commentaires
Lena
Lena le 24 Juin 2014
Excellent! Thank you.
Star Strider
Star Strider le 24 Juin 2014
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by