How to access parameters in histfit
8 次查看(过去 30 天)
显示 更早的评论
I am using histfit to fit gamma distribution in data.
histfit(data,'distribution,'gamma');
Now I want to retrieve parameters of fitted Gamma. How to do that??
0 个评论
回答(2 个)
Paulo Silva
2011-8-2
I don't understand exactly what you want, maybe getting the coordinates of the curve?
r = normrnd(10,1,100,1);
hf=histfit(r);
h = get(gca,'Children');
set(h(2),'FaceColor',[.8 .8 1])
get(hf(1)) %properties of the histogram
get(hf(2)) %properties of the normal curve
%you can retrieve and plot the curve
figure
x=get(hf(2),'XData');
y=get(hf(2),'YData');
plot(x,y)
0 个评论
Pieter De Wet
2019-1-21
编辑:Pieter De Wet
2019-1-21
histfit works with fitdist function. See the fitdist documentation, giving:
pd = fitdist(r,'Normal')
pd =
NormalDistribution
Normal distribution
mu = 10.1231 [9.89244, 10.3537]
sigma = 1.1624 [1.02059, 1.35033]
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!