MATLAB: Convert the hexadecimal representation of a binary double-precision number back into a double conversiondoublehexadecimalMATLABnumerics 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? Best Answer >> x=randx = 0.126986816293506>> s = sprintf('%bx',x)s =3fc0411a9f807b7c>> y=hex2num(s)y = 0.126986816293506 Related SolutionsMATLAB: Converting binary to decimal Why are you using uint16 when you have a negative number?????Anyway,...S = -5;Cw1=dec2bin(typecast(int16(S),'uint16'),15)S_recovered = bin2dec(Cw1)maxUint16 = intmax('uint16')maxInt16 = intmax('int16')if S_recovered > maxInt16 S_recovered = int16(S_recovered - double(maxUint16) - 1)endS_recovered will be -5 as a signed 16 bit integer, which is what I assume you want. MATLAB: How to convert int32 to real number X_real = double(X_int32);HTH Related QuestionHow to display double-precision floating-point number in binary representationHow to convert a string to binary and then from the binary back to stringFread + double-precision 8-byte floating point + precisionDecimal to Binary (ieee 754)How to set individual bits in 64-bit double-precision floating number
Best Answer