The results indicate that, for the first row, $1=\frac{1}{2}\left({2}^{1}\right)$. Similarly, for the fourth row, $\mathrm{eps}=\frac{1}{2}\left({2}^{-51}\right)$.

Input matrix, specified as a scalar, vector, matrix, or multidimensional
array.

For floating-point number dissection [F,E] = log2(X),
any zeros in X produce F = 0 and
E = 0. Input values of Inf,
-Inf, or NaN are returned
unchanged in F with a corresponding exponent of
E = 0.

Data Types: single | double Complex Number Support: Yes

Exponent values, returned as a scalar, vector, matrix, or multidimensional
array of the same size as X. The values in
F and E satisfy X =
F.*2.^E.

Tips

This function corresponds to the ANSI^{®}
C function frexp() and the IEEE^{®} floating-point standard function logb(). Any
zeros in X produce F = 0 and
E = 0.

Extended Capabilities

Tall Arrays Calculate with arrays that have more rows than fit in memory.

This function fully supports tall arrays. For
more information, see Tall Arrays.

C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.

GPU Arrays Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.

Usage notes and limitations:

The syntax [F,E] = log2(X) is not supported.

If the output of the function running on the GPU can be complex, then you must explicitly specify its input arguments as complex. For more information, see Work with Complex Numbers on a GPU (Parallel Computing Toolbox).

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.