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

조회 수: 1 (최근 30일)
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?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 3일
>> x=rand
x =
0.126986816293506
>> s = sprintf('%bx',x)
s =
3fc0411a9f807b7c
>> y=hex2num(s)
y =
0.126986816293506

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by