%% Convert Hexadecimal Format to Number with Fractional Part
% Create a character vector that represents a double-precision number in its IEEE® format, using hexadecimal digits.

hexStr = '400921fb54442d18';

%
% To convert it to the number that it represents, use the hex2num function. If hexStr represents a number with a fractional part, then hex2num converts it correctly.

X = hex2num(hexStr)

%
% You can convert X back to its hexadecimal representation using the num2hex function.

num2hex(X)

% Copyright 2019 The MathWorks, Inc.