Table Of Contents

log2

Version:
    Last Modified: December 12, 2016

    Computes the base 2 logarithm of the input elements.

    Syntax

    c = log2(a)
    [f, e] = log2(a)

    Inputs

    a

    Scalar or array of any dimension of floating point or complex numbers.

    Outputs

    c

    Base 2 logarithm of the elements in a. c returns complex numbers for negative or complex elements in a. c is an array of the same size as a.

    f

    Binary mantissa of the elements in a. f is an array of the same size as a.

    e

    Binary exponent of the elements in a. e is an array of the same size as a.

    Special Cases

    The base 2 logarithm of zero is -inf.

    [f, e] = log2(a) splits the input elements into binary mantissa f and exponent e so that the absolute value of f is equal to or greater than 0.5 and less than 1, and e is an integer. If a = 0, f = e = 0.

    A = [0.1, 1; 10, 100]
    C = log2(A)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: DAQExpress does not support FPGA devices


    Recently Viewed Topics