07-Jan-2022 20:35:21 gray_code_display_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test gray_code_display(). 07-Jan-2022 20:35:21 GRAY_CODE_DISPLAY: MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Consider the numbers 0 through N. We can represent them using the BINARY code or the GRAY code. Both codes can be thought of as vectors of M binary digits. The HAMMING DISTANCE between two vectors counts the number of digits that are different. In the binary code, the Hamming distance between two M vectors that represent consecutive integers can be any value from 1 to M. Using the Gray code, this Hamming distance is always 1. This implies that the Hamming distance between integers that are 2 places apart is 2, 3 places apart is 3 or less, and in general K places apart, no more than K digits will differ. The property that nearby integers have nearby Gray codes can be a very useful fact, for example, when using genetic algorithms. This program computes and compares the Hamming distance matrices for the binary and Gray codes. Note that for the Gray code, there is an obvious smooth valley running along the diagonal. Number of binary digits required for 17 is 5 GRAY_CODE_DISPLAY: Normal end of execution. 07-Jan-2022 20:35:28 gray_code_display_test(): Normal end of execution. 07-Jan-2022 20:35:28