This function converts a binary number (base2) to a gray code
bin2gray(x)
x
The binary number (base2) or a logical vector.
The gray code as logical vector.
gray2bin