b = de2bi(d) converts
a nonnegative decimal integer d to a binary row
vector. If d is a vector, the output b is
a matrix in which each row is the binary form of the corresponding
element in d.

Decimal input which can be a scalar, vector, or matrix. Specify
elements as nonnegative integers. If d is a matrix,
it is treated like the column vector d(:).

Example: 4

Example: [10;
5]

Note

To ensure an accurate conversion, d must
be less than or equal to 2^{52}.

n — Number of output columns positive integer scalar

The number of output columns specified as a positive scalar.
If necessary, the binary representation of d is
padded with extra zeros.

Example: 3

p — Base positive integer scalar

An integer that specifies the base of the output b.
Specify as an integer greater than or equal to 2.
The first column of b is the lowest base-p digit.
The output is padded with extra zeros if necessary so that it has n columns.
If d is a nonnegative decimal vector, the output b is
a matrix in which each row is the base-p form
of the corresponding element in d. If d is
a matrix, de2bi treats it like the vector d(:).

Example: 8

flg — MSB flag 'right-msb' | 'left-msb'

Character vector that determines whether the first column of b contains
the lowest-order or highest-order digits. If omitted, de2bi assumes 'right-msb'.

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.