# de2bi

Converts non-negative integers to their equivalents in binary or a specified base.

## Syntax

R = de2bi(v)

R = de2bi(v, cols)

R = de2bi(v, cols, base)

R = de2bi(v, cols, base, fmt)

## Inputs

`v`- Finite, non-negative vector of integers.
`cols`(optional)- Specifies the number of columns in the output,
`R`. An empty matrix can be specified if the number of columns is not restricted. If the length of the output,`R`, is less than`cols`, zeros will be padded to the most significant bit of the output. If the length of the output,`R`, is more than`cols`, the least significant part of the result is returned. `base`(optional)- Integer greater than or equal to 2 (default), used as the base for the output,
`R`. `fmt`(optional)- Contains values 'right-msb' or 'left-msb', which
specify whether the first or last element of
`R`is most-significant. The default value is 'right-msb'.

## Outputs

- R
- Binary representation of
`v`. There will be a row for each number in`v`.

## Examples

Integer to binary with default
values:

`R = de2bi(56)`

```
R = [Matrix] 1 x 6
0 0 0 1 1 1
```

Vector to binary in base
3:

`R = de2bi([97, 65], [], 3)`

```
R = [Matrix] 2 x 5
1 2 1 0 1
2 0 1 2 0
```

Vector to binary in base 3, specifying columns in output and left-msb:

`R = de2bi([97, 65], 4, 3, 'left-msb')`

```
R = [Matrix] 2 x 4
0 1 2 1
2 1 0 2
```