next up previous contents
Next: DAWSON Dawson Integral Function Up: Mathematical Functions Previous: ERFC Complimentary Error Function   Contents

Subsections

ERF Error Function

Usage

Computes the error function for real arguments. The erf function takes only a single argument

  y = erf(x)

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

Function Internals

The erf function is defined by the integral:

$\displaystyle \mathrm{erf}(x) = \frac{2}{\sqrt{\pi}}\int_{0}^{x} e^{-t^2}   dt,
$

and is the integral of the normal distribution.

Example

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

--> x = linspace(-5,5);
--> y = erf(x);
--> plot(x,y); xlabel('x'); ylabel('erf(x)');

which results in the following plot.

3539



Samit K. Basu 2005-03-16