View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Two's Complement Binary Strings

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0 | 1 rating Rate this file 24 Downloads (last 30 days) File Size: 4.4 KB File ID: #38889 Version: 1.0

Two's Complement Binary Strings


Drew Compston (view profile)


Convert between binary fixed point two's complement strings and decimal numbers.

| Watch this File

File Information

These functions convert between binary strings and decimal numbers like the built-in MATLAB functions BIN2DEC and DEC2BIN but can accommodate negative integers (via two's complement) and fractional positive and negative numbers (via two's complement fixed point with a binary point in the string).

Note that many fractional numbers that can be represented with a finite number of fractional digits cannot be represented by a finite number of fractional bits (specifically non-powers-of-two fractions like 0.3), which means that FIX2DEC will not always exactly invert DEC2FIX.


This file inspired Di 155 Acquisition V1.0.

Required Products MATLAB
MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
23 Oct 2016 naghma tabassum  

Contact us