Cody

Solution 2020326

Submitted on 14 Nov 2019 by Nikolaos Nikolaou
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))

b = '10001' y = 1 y = 1 1 y = 1 1 0 y = 1 1 0 0 y = 1 1 0 0 1

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

b = '111' y = 1 y = 1 0 y = 1 0 0

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

b = '11' y = 1 y = 1 0

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

b = '11111' y = 1 y = 1 0 y = 1 0 0 y = 1 0 0 0 y = 1 0 0 0 0

Suggested Problems

More from this Author148