%% Convert Double-Precision Number with Fractional Part
% Create a number and represent it in its IEEE® format using hexadecimal digits. X is a double-precision number and has a fractional part.

X = 3.1416;
hexStr = num2hex(X)

%
% Since hexStr is in IEEE format, it also represents the fractional part of X. You can convert hexStr back to a number using the hex2num function.

hex2num(hexStr)

% Copyright 2019 The MathWorks, Inc.