Navigation

Operators and Keywords

Function List:

C++ API

: dec2base (d, base)
: dec2base (d, base, len)

Return a string of symbols in base base corresponding to the non-negative integer d.

dec2base (123, 3)
   ⇒ "11120"

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.

If base is a string then the characters of base are used as the symbols for the digits of d. Space (’ ’) may not be used as a symbol.

dec2base (123, "aei")
   ⇒ "eeeia"

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

See also: base2dec, dec2bin, dec2hex.

Package: octave