Floating number conversion to binary and vice-versa

Converts a fractional value to binary and vice versa
6.5K Downloads
Updated 16 Jul 2012

View License

This M-File extends MATLAB's inbuilt dec2bin() and bin2dec() functions functionalities. When you enter a floating point number as 25.757 you expect to get the correspoing binary number and vice versa.Feel free to make corrections. But make reference to me where needed(laugh).

Cite As

Gordon Amoako (2024). Floating number conversion to binary and vice-versa (https://www.mathworks.com/matlabcentral/fileexchange/13899-floating-number-conversion-to-binary-and-vice-versa), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.3.0.0

f_d2b has been made shorter

1.2.0.0

f_b2d.m has been made simpler.

1.1.0.0

I have made the f_b2d rather shorter. Taken the for loops and used the 'find' function effectively.

1.0.0.0