log10

Common (base 10) logarithm.

Category: Mathematics > Elementary Math

Syntax

Y = log10(X)

Returns the base-10 logarithm of each element of X.

Description

log10(x) is the exponent to which 10 must be raised to get x, so log10(1000) is exactly 3. It is the natural scale for decibels (20*log10(ratio)), pH, the Richter scale and any quantity spanning many orders of magnitude, and floor(log10(x)) gives the order of magnitude of x.

Input arguments

X
Numeric array, real or complex.

Output arguments

Y
Array of the same size as X. Zero gives -Inf, a negative real gives a complex result.

Example

Powers of ten and decibels

log10([1 10 1000])
log10(2)
20*log10(10)
Output
ans = 1×3

     0     1     3
ans = 0.3010
ans = 20

See also

log log2 log1p exp nextpow2