next up previous contents
Next: COS Trigonometric Cosine Function Up: Mathematical Functions Previous: LOG Natural Logarithm Function   Contents

Subsections

EXP Exponential Function

Usage

Computes the exp function for its argument. The general syntax for its use is

   y = exp(x)

where x is an n-dimensional array of numerical type. Integer types are promoted to the double type prior to calculation of the exp function. Output y is of the same size and type as the input x, (unless x is an integer, in which case y is a double type).

Function Internals

Mathematically, the exp function is defined for all real valued arguments x as

$\displaystyle \exp x \equiv e^{x},
$

where

$\displaystyle e = \sum_{0}^{\infty} \frac{1}{k!}
$

and is approximately 2.718281828459045 (returned by the function e). For complex values z, the famous Euler formula is used to calculate the exponential

$\displaystyle e^{z} = e^{\vert z\vert} \left[ \cos \Re z + i \sin \Re z \right]
$

Example

The following piece of code plots the real-valued exp function over the interval [-1,1]:

--> x = linspace(-1,1);
--> plot(x,exp(x))

2817

In the second example, we plot the unit circle in the complex plane e^{i 2 pi x} for x in [-1,1].

--> x = linspace(-1,1);
--> plot(exp(-i*x*2*pi))

2820


next up previous contents
Next: COS Trigonometric Cosine Function Up: Mathematical Functions Previous: LOG Natural Logarithm Function   Contents
Samit K. Basu 2005-03-16