Code covered by the BSD License  

Highlights from
Gamma Function PDF

image thumbnail

Gamma Function PDF

by

 

matlab code for ploting the pdf of the gamma function.

gamma_pdf.m
% this code is written by Jamal A. Hussein
% barznjy79@yahoo.com
% all rights reserved

clc;
clear all;
close all;

colors=['r','g','b'] ;
theta = 2;

x = [0:1:20];
for k = 1:3
for ii = 1:length(x)

do = (1/(gamma(k)*theta.^k));
y (ii)= do * x(ii).^(k-1) * exp(-x(ii)/theta);

end

plot(x,y,colors(k))
hold on

end

grid on
legend('k=1','k=2','k=3')

Contact us