int2bin - bin2int

Convert integer datatype to a binary string and back
252 Downloads
Updated 12 Apr 2017

Convert integer datatype to a binary string and back.

int2bin(X) returns the binary representation of X as a string. X must be an integer datatype and non-negative. Unlike Matlab's dec2bin, int2bin supports int64 and uint64 values of X greater than 2^52.

bin2int(S) returns the integer value represented by the binary string S. The class of the output is the minimum unsigned integer class that supports the number of bits in the binary string. Unlike Matlab's bin2dec, bin2int supports binary strings with up to 64 bits.

Cite As

Andrew Horchler (2024). int2bin - bin2int (https://github.com/horchler/int2bin-bin2int), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Numeric Types in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.0.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.