Navigation

Operators and Keywords

Function List:

C++ API

: y = bitpack (x, class)

Return a new array y resulting from interpreting the logical array x as raw bit patterns for data of the numeric class class.

class must be one of the built-in numeric classes:

"double"
"single"
"double complex"
"single complex"
"char"
"int8"
"int16"
"int32"
"int64"
"uint8"
"uint16"
"uint32"
"uint64"

The number of elements of x should be divisible by the bit length of class. If it is not, excess bits are discarded. Bits come in increasing order of significance, i.e., x(1) is bit 0, x(2) is bit 1, etc.

The result is a row vector if x is a row vector, otherwise it is a column vector.

See also: bitunpack, typecast.

Package: octave