exp
Exponential function e^x, element by element.
Category: Mathematics > Elementary Math
Syntax
Y = exp(X)
Returns e raised to each element of X.
Description
For a real argument exp(x) is the usual exponential, positive for every x, equal to 1 at 0, overflowing to Inf for arguments above about 709.78. For a complex argument x + iy the result is exp(x)*(cos(y) + i*sin(y)), which is Euler's formula.
To get the matrix exponential of a square matrix, use expm. exp always works element by element.
Input arguments
X- Numeric array, real or complex.
Output arguments
Y- Array of the same size as
X.
Example
Real and complex arguments
exp([0 1 2])
exp(1i*pi)
exp(710)
Output
ans = 1×3
1.0000 2.7183 7.3891
ans = -1.0000 + 1.2246e-16i
ans = Inf