Convert the hexadecimal representation of a binary double-precision number back into a double

4 views (last 30 days)
How can I convert a double-precision hexadecimal back into a double?
That is, given s, created from the double x as such:
s = sprintf('%bx',x)
How can I recover x?

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 3 Nov 2011
>> x=rand
x =
>> s = sprintf('%bx',x)
s =
>> y=hex2num(s)
y =

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!