How to convert binary to floating points?
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Guillaume
le 9 Mai 2019
wavsingle = typecast(uint8(sum(wavbinary .* 2.^(7:-1:0), 2)), 'single')
0 commentaires
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!