Cody

# Problem 42849. RGB to CMYK

Solution 1817192

Submitted on 16 May 2019
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
RGB = [0,0,0]; CMYK = [0,0,0,1]; assert(isequal(rgb2cmyk(RGB),CMYK))

Error in solution Line: 5 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "rgb2cmyk".)

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

Error in solution Line: 5 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "rgb2cmyk".)

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

Error in solution Line: 5 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "rgb2cmyk".)

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

Error in solution Line: 5 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "rgb2cmyk".)

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

Error in solution Line: 5 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "rgb2cmyk".)