File Exchange

image thumbnail

int2bin - bin2int

version (4.35 KB) by Andrew Horchler
Convert integer datatype to a binary string and back

1 Download

Updated 12 Apr 2017

From GitHub

View license on GitHub

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 (2021). int2bin - bin2int (, GitHub. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2016a
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!