Examine several common values of the exponential function.
Calculate the exponential of 0.
ans = 1
The result is 1, which is the y-intercept of the exp function.
Calculate the exponential of 1.
ans = 2.7183
The result is equal to Euler's number, e.
Calculate the exponential of iπ.
ans = -1.0000 + 0.0000i
The result of -1 is due to Euler's famous formula
Calculate the exponential of -Inf.
ans = 0
The result is 0 since exp returns small values for negative inputs.
Define the domain.
X = (-1:0.5:5)';
Calculate the exponential of the vector, X.
Y = exp(X)
Y = 0.3679 0.6065 1.0000 1.6487 2.7183 4.4817 7.3891 12.1825 20.0855 33.1155 54.5982 90.0171 148.4132
The result is a vector of exponential values.
Plot the function values.
plot(X,Y,'LineWidth',1.5) grid on; title('Real-Valued Exponential Function'); xlabel('X'); ylabel('Y');
The real-valued exponential function maps values in the domain of all real numbers to the range of .
Define a grid of values for the (X,Y) domain.
[X,Y] = meshgrid(0:0.5:10,0:0.5:10);
Calculate the complex exponential on the grid.
Z = exp(X+1i*Y);
Make a surface plot of the imaginary portion of the function.
surf(X,Y,imag(Z)) grid on; hold on; xlabel('X'); ylabel('Y'); zlabel('Z'); view(44,42)
exp is a continuous function on the complex plane.
Plot the real portion of the function in the same figure.
In this plot, the real and complex portions of the function are 90 degrees out of phase. Analytically, this is because the real portion depends on cos, whereas the complex portion depends on sin.