next up previous contents
Next: IDIV Integer Division Operation Up: Mathematical Functions Previous: GAMMA Gamma Function   Contents

Subsections

GAMMALN Log Gamma Function

Usage

Computes the natural log of the gamma function for real arguments. The gammaln function takes only a single argument

  y = gammaln(x)

where x is either a float or double array. The output vector y is the same size (and type) as x.

Example

Here is a plot of the gammaln function over the range [-5,5].

--> x = linspace(0,10);
--> y = gammaln(x);
--> plot(x,y); xlabel('x'); ylabel('gammaln(x)');

which results in the following plot.

3707



Samit K. Basu 2005-03-16