Log base 2 of symbolic input
Compute the log base 2 of numeric input.
ans = 4.3219
Compute the log base 2 of symbolic input. The result is in terms of
syms x f = x^2; fLog2 = log2(f)
fLog2 = log(x^2)/log(2)
Convert symbolic output to double by substituting for
x with a
number by using
subs, and then using
fLog2 = subs(fLog2,x,5); % x is 5 fLog2 = double(fLog2)
fLog2 = 4.6439
Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.