The function decode4int converts each element in a given binary vector to a integer number.
decode4int(x, M, ...)
A vector containing binary numbers
A vector containing the number of bits of each binary in the x.
Further arguments passed to or from other methods.
A vector of integer for input binary vector
This function converts each element in the binary vector passed with the x argument to an integer. The M argument refers to the number of bits of each binary in the x vector.
# NOT RUN {
binmat = c(0,0,1,1,1,0,0,1,0,0,1,0)
M = c(4,4,4)
intmat = decode4int(binmat, M=M)
intmat
# }
Run the code above in your browser using DataLab