fitdist() how to return sigma value?

8 次查看(过去 30 天)
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)

采纳的回答

Star Strider
Star Strider 2014-6-24
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

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by