Cody

Solution 2023023

Submitted on 15 Nov 2019 at 12:59 by Atsushi Ueno
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 = 17; y_correct = [1 1 0 0 1]; assert(isequal(dec2gray(x),y_correct))

shft = 8 gray = 25 y = 1 1 0 0 1

2   Pass
x = 7; y_correct = [1 0 0]; assert(isequal(dec2gray(x),y_correct))

shft = 3 gray = 4 y = 1 0 0

3   Pass
x = 3; y_correct = [1 0]; assert(isequal(dec2gray(x),y_correct))

shft = 1 gray = 2 y = 1 0

4   Pass
x = 31; y_correct = [1 0 0 0 0]; assert(isequal(dec2gray(x),y_correct))

shft = 15 gray = 16 y = 1 0 0 0 0