How to convert binary to floating points?
조회 수: 15 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Guillaume
2019년 5월 9일
wavsingle = typecast(uint8(sum(wavbinary .* 2.^(7:-1:0), 2)), 'single')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!