Plotting Gamma Distribution, please help?
Afficher commentaires plus anciens
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,'-');
Réponses (5)
Youssef Khmou
le 22 Sep 2014
It is correct, you just need to exchange pdf with X :
plot(x,pdf);
2 commentaires
Hydro
le 22 Sep 2014
Youssef Khmou
le 22 Sep 2014
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
le 22 Sep 2014
0 votes
Hydro
le 22 Sep 2014
0 votes
2 commentaires
Youssef Khmou
le 22 Sep 2014
X=1:100; ALPHA=3; BETA=2; PDF=gampdf(X,ALPHA,BETA); plot(X,PDF);

Hydro
le 22 Sep 2014
Benabed Rabia
le 2 Jan 2018
Modifié(e) : Benabed Rabia
le 2 Jan 2018
0 votes
When i use plot command the graph just links the dots it does not give a curve, please help me! Thanks in advence
Catégories
En savoir plus sur Gamma Distribution dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
