Floating number conversion to binary and vice-versa

Converts a fractional value to binary and vice versa

You are now following this Submission

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 (2026). 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 .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
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