Friday, July 31, 2009

dec2bin

Decimal to binary number conversion

Syntax

  • str = dec2bin(d)
    str = dec2bin(d,n)

Description

str = dec2bin(d) returns the binary representation of d as a string. d must be a nonnegative integer smaller than 2^52.

str = dec2bin(d,n) produces a binary representation with at least n bits.

Examples


  • ans =
    10111

No comments:

Post a Comment