Skip to content

bitcmp

general · scripts/general/bitcmp.m

: c = bitcmp (a)
: c = bitcmp (a, assumedtype)
: c = bitcmp (a, k)

Return the bitwise complement of a.

MATLAB R2026a: with one argument, integer a is complemented in its own class; double a is treated as unsigned 64-bit and the result is double. With a character assumedtype ("uint8" … "int64"), double a is complemented in that integer class and returned as double; integer a may only pass its own class name.

Nexus also accepts a scalar integer k (legacy / Octave-style) that complements only the low k bits.