[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

## 17.1 Exponents and Logarithms

__Mapping Function:__**exp***(*`x`)Compute

`e^x`

for each element of`x`. To compute the matrix exponential, see Linear Algebra.**See also:**log.

__Mapping Function:__**expm1***(*`x`)Compute

`exp (`

accurately in the neighborhood of zero.`x`) - 1**See also:**exp.

__Mapping Function:__**log***(*`x`)Compute the natural logarithm,

`ln (`

, for each element of`x`)`x`. To compute the matrix logarithm, see Linear Algebra.

__Mapping Function:__**log2***(*`x`)__Mapping Function:__[`f`,`e`] =**log2***(*`x`)Compute the base-2 logarithm of each element of

`x`.If called with two output arguments, split

`x`into binary mantissa and exponent so that`1/2 <= abs(f) < 1`

and`e`is an integer. If`x = 0`

,`f = e = 0`

.

__Function File:__**nextpow2***(*`x`)If

`x`is a scalar, return the first integer`n`such that 2^n >= abs (x).If

`x`is a vector, return`nextpow2 (length (`

.`x`))

__Function File:__**nthroot***(*`x`,`n`)Compute the n-th root of

`x`, returning real results for real components of`x`. For examplenthroot (-1, 3) ⇒ -1 (-1) ^ (1 / 3) ⇒ 0.50000 - 0.86603i

__Mapping Function:__**pow2***(*`x`)__Mapping Function:__**pow2***(*`f`,`e`)With one argument, computes 2 .^ x for each element of

`x`.With two arguments, returns f .* (2 .^ e).

__Function File:__**reallog***(*`x`)Return the real-valued natural logarithm of each element of

`x`. Report an error if any element results in a complex return value.

__Function File:__**realpow***(*`x`,`y`)Compute the real-valued, element-by-element power operator. This is equivalent to

, except that`x`.^`y``realpow`

reports an error if any return value is complex.

__Function File:__**realsqrt***(*`x`)Return the real-valued square root of each element of

`x`. Report an error if any element results in a complex return value.

__Mapping Function:__**sqrt***(*`x`)Compute the square root of each element of

`x`. If`x`is negative, a complex result is returned. To compute the matrix square root, see Linear Algebra.**See also:**realsqrt.

[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |