matlab将单精度IEEE十六进制字符串转换为数字

收录时间:2019-03-11
资源分类:Matlab 工具:MATLAB 7.0.1 (R14SP1)

matlab将单精度IEEE十六进制字符串转换为数字

 

hexsingle2num

hexsingle2num converts a single precision IEEE hexadecimal string to a number.

 

hexsingle2num is a version of hex2num which works with single precision floats. Currently MATLAB hex2num converts to double precision floats.

 

HEXSINGLE2NUM(S), where S is a 8 character string containing a hexadecimal number, returns a double type number equal to the IEEE single precision floating point number it represents. Fewer than 8 characters are padded on the right with zeros.

 

If S is a character array, each row is interpreted as a single precision number (and returned as a double).

 

NaNs, infinities and denorms are handled correctly.

 

Example:

  hexsingle2num('40490fdb') returns Pi.

  hexsingle2num('bf8') returns -1.

文件下载列表
hexsingle2num.zip (2.23KB)  
附件内容(只显示2中的1个)
hexsingle2num.m  
更多

目前尚无评论

用户反馈   关于我们
Copyright (©) ZHIHUISHI.COM 2013 All Rights Reserved.
京ICP备14040384号