| Contents | Index |
erfc(x)
erfc(A)
erfc(x) computes the complementary error function of x.
erfc(A) computes the complementary error function of each element of A.
Calling erfc for a number that is not a symbolic object invokes the MATLAB erfc function. This function accepts real arguments only. If you want to compute the complementary error function for a complex number, use sym to convert that number to a symbolic object, and then call erfc for that symbolic object.
x |
Symbolic number, variable, or expression. |
A |
Vector or matrix of symbolic numbers, variables, or expressions. |
The following integral defines the complementary error function:
![]()
Here erf(x) is the error function.
Compute the complementary error function for these numbers. Because these numbers are not symbolic objects, you get the floating-point results:
[erfc(1/2), erfc(1.41), erfc(sqrt(2))]
ans =
0.4795 0.0461 0.0455Compute the complementary error function for the numbers converted to symbolic objects. For most symbolic (exact) numbers, erfc returns unresolved symbolic calls:
[erfc(sym(1/2)), erfc(sym(1.41))]
ans = [ erfc(1/2), erfc(141/100)]
Compute the complementary error function for x = 0, x = ∞, and x = –∞. The complementary error function has special values for these parameters:
[erfc(0), erfc(inf), erfc(-inf)]
ans =
1 0 2Compute the complementary error function for complex infinities. Use sym to convert complex infinities to symbolic objects:
[erfc(sym(i*inf)), erfc(sym(-i*inf))]
[ 1 - Inf*i, Inf*i + 1]
Compute the complementary error function for x and sin(x) + x*exp(x). For most symbolic variables and expressions, erfc returns unresolved symbolic calls:
syms x f = sin(x) + x*exp(x); erfc(x) erfc(f)
ans = erfc(x) ans = erfc(sin(x) + x*exp(x))
Now compute the derivatives of these expressions:
diff(erfc(x), x, 2) diff(erfc(f), x)
ans = (4*x*exp(-x^2))/pi^(1/2) ans = -(2*exp(-(sin(x) + x*exp(x))^2)*(cos(x) + exp(x) + x*exp(x)))/pi^(1/2)
Compute the complementary error function for elements of matrix M and vector V:
M = sym([0 inf; 1/3 -inf]); V = sym([1; -i*inf]); erfc(M) erfc(V)
ans = [ 1, 0] [ erfc(1/3), 2] ans = erfc(1) Inf*i + 1
The toolbox can simplify expressions that contain error functions and their inverses. For real values x, the toolbox applies these simplification rules:
erfinv(erf(x)) = erfinv(1 - erfc(x)) = erfcinv(1 - erf(x)) = erfcinv(erfc(x)) = x
erfinv(-erf(x)) = erfinv(erfc(x) - 1) = erfcinv(1 + erf(x)) = erfcinv(2 - erfc(x)) = -x
For any value x, the system applies these simplification rules:
erfcinv(x) = erfinv(1 - x)
erfinv(-x) = -erfinv(x)
erfcinv(2 - x) = -erfcinv(x)
erf(erfinv(x)) = erfc(erfcinv(x)) = x
erf(erfcinv(x)) = erfc(erfinv(x)) = 1 - x
Gautschi, W. "Error Function and Fresnel Integrals." Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. (M. Abramowitz and I. A. Stegun, eds.). New York: Dover, 1972.

See how symbolic computations can help you find analytical solutions to math and engineering problems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |