How to convert binary to floating points?

15 ビュー (過去 30 日間)
N M Channabasavayya
N M Channabasavayya 2019 年 5 月 9 日
回答済み: Guillaume 2019 年 5 月 9 日
I have the following code,which converts the wavdata into binary sequence.
wavbinary = dec2bin( typecast(single(wavdata(:)),'uint8'),8)-'0';
Now I want to convert the binary bits into floating poins such that the new floating points should match to the wavdata contents.
help me out!
Thank you

回答 (1 件)

Guillaume
Guillaume 2019 年 5 月 9 日
wavsingle = typecast(uint8(sum(wavbinary .* 2.^(7:-1:0), 2)), 'single')

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by