Contents Previous Next Subchapters

The Logarithm Of The Gamma Function
Syntax gammln(z)
See Also gammaln , gamma , gammainc , beta , besselj , bessely , erf

Description
Returns the element-by-element logarithm of the gamma function, where z is a real, double-precision, or complex matrix such that the real part of each element of z is greater than 0. The return value has the same type and dimension as z.

Gamma Function
The gamma function is defined by
                +inf
                /   - t  (z - 1)
     gamma(z) = |  e    t       dt
                /
                0

Example
     ginit
     x = .1 : .1 : 3. 
     gtitle("Log of Gamma Function")
     gplot(x, gammln(x))

returns the following plot:

Mlmode
In Mlmode , this function is automatically included as gammaln as instead of gammln. If in Mlmode you enter
     clear
     x = .1 : .1 : 3.;
     omgtitle('Log of Gamma Function');
     plot(x, gammaln(x));

O-Matrix will draw the plot above.