Cody

Solution 2044541

Submitted on 3 Dec 2019 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 1000; y_correct = 1100; assert(isequal(binary2gray(x),y_correct))

a = '1000' b = 1 1 b = 1 1 0 b = 1 1 0 0 c = '1 1 0 0' d = '1100' y = 1100

2   Pass
x = 0010; y_correct = 0011; assert(isequal(binary2gray(x),y_correct))

a = '10' b = 1 1 c = '1 1' d = '11' y = 11

3   Pass
x = 0011; y_correct = 0010; assert(isequal(binary2gray(x),y_correct))

a = '11' b = 1 0 c = '1 0' d = '10' y = 10