Two's Complement

Compute the two's complement value of an unsigned integer

You are now following this Submission

This is a very simple utility that computes the two's complement value from an unsigned integer input. The number of bits of the input integer must also be specified

Cite As

Chad Webb (2026). Two's Complement (https://www.mathworks.com/matlabcentral/fileexchange/14900-two-s-complement), 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.0.0.0