Cody

Solution 2261759

Submitted on 7 May 2020
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   Fail
x = [0,0,0.0001]; y_correct = '000000'; assert(isequal(rgb2hex(x),y_correct))

ans = 3×1 char array '0' '0' '0' ans = '000'

Assertion failed.

2   Pass
x = [1,1,1]; y_correct = 'FFFFFF'; assert(isequal(rgb2hex(x),y_correct))

ans = 3×2 char array 'FF' 'FF' 'FF' ans = 'FFFFFF'

3   Pass
x = [.5,.5,.2]; y_correct = '7F7F33'; assert(isequal(rgb2hex(x),y_correct))

ans = 3×2 char array '7F' '7F' '33' ans = '7F7F33'