Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

dec2base - Convert decimal to base N number in string

Syntax

str = dec2base(d, base)
str = dec2base(d, base, n)

Description

str = dec2base(d, base) converts the nonnegative integer d to the specified base. d must be a nonnegative integer smaller than 2^52, and base must be an integer between 2 and 36. The returned argument str is a string.

str = dec2base(d, base, n) produces a representation with at least n digits.

Examples

The expression dec2base(23, 2) converts 2310 to base 2, returning the string '10111'.

See Also

base2dec

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS