decimalToBinaryVector
R2026bConvert decimal value to binary vector
Syntax
Description
This function is part of Data Acquisition Toolbox™, and converts decimal values to binary data represented by a vector of
1s and 0s. To convert to binary data as a character vector, use the MATLAB® function dec2bin.
converts a positive decimal number to a binary vector that uses the minimum
number of bits necessary.binVal = decimalToBinaryVector(decimalNumber)
converts a decimal number to a binary vector with the specified number of
bits.binVal = decimalToBinaryVector(decimalNumber,numberOfBits)
converts a decimal number to a binary vector with the specified number of bits
in the specified bit ordering.binVal = decimalToBinaryVector(decimalNumber,numberOfBits,bitOrder)
converts a decimal number to a binary vector with the default number of bits in
the specified bit ordering.binVal = decimalToBinaryVector(decimalNumber,[],bitOrder)
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2012b