Exponents and Logarithms
Exponential, logarithm, power, and root functions
In addition to common functions like
log, MATLAB® has several other related functions to allow flexible numerical calculations.
log1p functions compensate for numerical round-off errors in small arguments,
realsqrt functions restrict the range of these
functions to real numbers.
nthroot calculates roots of any order, while the
nextpow2 calculate powers of two.
|Common logarithm (base 10)|
|Compute natural logarithm of |
|Base 2 logarithm and floating-point number dissection|
|Exponent of next higher power of 2|
|Real nth root of real numbers|
|Base 2 exponentiation and scaling of floating-point numbers|
|Natural logarithm for nonnegative real arrays|
|Array power for real-only output|
|Square root for nonnegative real arrays|
- Powers and Exponentials
This topic shows how to compute matrix powers and exponentials using a variety of methods.
- Graphical Comparison of Exponential Functions
This example shows an interesting graphical approach for discovering whether e^pi is greater than pi^e.