Cody

Solution 886674

Submitted on 6 May 2016 by LY Cao
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
RGB = [0,0,0]; CMYK = [0,0,0,1]; assert(isequal(rgb2cmyk(RGB),CMYK))

2   Pass
RGB = [1,1,1]; CMYK = [0,0,0,0]; assert(isequal(rgb2cmyk(RGB),CMYK))

3   Pass
RGB = [1,0,0]; CMYK = [0,1,1,0]; assert(isequal(rgb2cmyk(RGB),CMYK))

4   Pass
RGB = [1,1,0]; CMYK = [0,0,1,0]; assert(isequal(rgb2cmyk(RGB),CMYK))

5   Pass
RGB = [150,25,0]/255; CMYK = [0,5/6,1,7/17]; error = abs(rgb2cmyk(RGB)-CMYK); assert(all(error<1e-4))