# dec2bin

Convert decimal number to base 2.

## Syntax

* R = dec2bin(D)
* R = dec2bin(D, N)

## Input argument

* D - a non negative integer smaller than the value returned by flintmax.
* N - an integer value. number of digits.

## Output argument

* R - result of dec2bin: char array.

## Description

**dec2bin** converts decimal number to base 2.

## Example

```matlab
Y = dec2bin(2)
```

## See also

[dec2base](base2dec), [bin2dec](bin2dec).

## History

| Version | Description     |
| ------- | --------------- |
| 1.0.0   | initial version |

## Author

Allan CORNET
