Matlab single precision 與 hex碼互換

 Single precision轉換成hex code: 

A = num2hex(single(10*log10(2)));

結果 A為'4040a8c1'

 

hex code(string) 轉換成single precision: 

B = typecast(uint32(hex2dec('4040a8c1')),'single');

結果B為 3.0103 (也就是10*log10(2))

留言

這個網誌中的熱門文章

C# 不規則陣列不定長度設定方法

用C#建立電腦保護螢幕程式

C# picturebox的Image 取得網路攝像頭圖像資料