How to access parameters in histfit
조회 수: 6 (최근 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!