Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Error function

`erf(x)`

`erf(`

returns the Error Function evaluated for each element
of `x`

)`x`

.

You can also find the standard normal probability distribution using the Statistics and Machine Learning Toolbox™ function

`normcdf`

. The relationship between the error function`erf`

and`normcdf`

is$$\text{normcdf}\left(x\right)=\frac{1}{2}\left(1-\text{erf}\left(\frac{-x}{\sqrt{2}}\right)\right).$$

For expressions of the form

`1 - erf(x)`

, use the complementary error function`erfc`

instead. This substitution maintains accuracy. When`erf(x)`

is close to`1`

, then`1 - erf(x)`

is a small number and might be rounded down to`0`

. Instead, replace`1 - erf(x)`

with`erfc(x)`

.