Navigation

Operators and Keywords

Function List:

C++ API

: dec2bin (d, len)

Return a binary number corresponding to the non-negative integer d, as a string of ones and zeros.

For example:

dec2bin (14)
     ⇒ "1110"

If d is a matrix or cell array, return a string matrix with one row per element in d, padded with leading zeros to the width of the largest value.

The optional second argument, len, specifies the minimum number of digits in the result.

See also: bin2dec, dec2base, dec2hex.

Package: octave