log

Natural logarithm of entries of symbolic matrix

Syntax

Y = log(X)

Description

Y = log(X) returns the natural logarithm of X.

Input Arguments

X

Symbolic variable, expression, function, or matrix

Output Arguments

Y

Number, variable, expression, function, or matrix. If X is a matrix, Y is a matrix of the same size, each entry of which is the logarithm of the corresponding entry of X.

Examples

Compute the natural logarithm of each entry of this symbolic matrix:

syms x
M = x*hilb(2);
log(M)
ans =
[   log(x), log(x/2)]
[ log(x/2), log(x/3)]

Differentiate this symbolic expression:

syms x
diff(log(x^3), x)
ans =
3/x

See Also

|

Was this topic helpful?