Plotting Gamma Distribution, please help?
이전 댓글 표시
These are my code, however, i am not getting the plot.
X=1:100; % Duration of data
Data=rand(1,100); % randomly generated 100 years of data
Z=gamfit(Data); % fitting distribution for shape and scale factor
beta=2; % Shape factor
alpha=3; % scale factor
pdf=gampdf(X,alpha,beta); % pdf of the gamma distribution
Plot(pdf,X,'-');
답변 (5개)
Youssef Khmou
2014년 9월 22일
It is correct, you just need to exchange pdf with X :
plot(x,pdf);
댓글 수: 2
Hydro
2014년 9월 22일
Youssef Khmou
2014년 9월 22일
the variables alpha and beta are in the system , change theirs names to Alpha, Beta for example.
Change capital P-letter to small P-letter, MATLAB is case senstive!
plot(pdf,X,'-');
Hydro
2014년 9월 22일
0 개 추천
댓글 수: 2
Youssef Khmou
2014년 9월 22일
X=1:100; ALPHA=3; BETA=2; PDF=gampdf(X,ALPHA,BETA); plot(X,PDF);

Hydro
2014년 9월 22일
Benabed Rabia
2018년 1월 2일
편집: Benabed Rabia
2018년 1월 2일
0 개 추천
When i use plot command the graph just links the dots it does not give a curve, please help me! Thanks in advence
카테고리
도움말 센터 및 File Exchange에서 Gamma Distribution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
