Cody

Solution 1944107

Submitted on 20 Sep 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   Pass
filetext = fileread('cumin.m'); assert(isempty(strfind(filetext,'cummin'))) assert(isempty(strfind(filetext,'cummax'))) assert(isempty(strfind(filetext,'feval')))

2   Fail
x = randi(100); assert(isequal(cumin(x),cummin(x))) assert(isequal(cumin(x,1),cummin(x,1))) assert(isequal(cumin(x,2),cummin(x,2))) assert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse'))) assert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse'))) assert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))

Index exceeds the number of array elements (0). Error in cumin (line 5) main = main(1); Error in Test2 (line 2) assert(isequal(cumin(x),cummin(x)))

3   Fail
x = randi(100,randi([2 100]),1); assert(isequal(cumin(x),cummin(x))) assert(isequal(cumin(x,1),cummin(x,1))) assert(isequal(cumin(x,2),cummin(x,2))) assert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse'))) assert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse'))) assert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))

2 2 2 2 2 51 51 2

Assertion failed.

4   Fail
x = randi(100,1,randi([2 100])); assert(isequal(cumin(x),cummin(x))) assert(isequal(cumin(x,1),cummin(x,1))) assert(isequal(cumin(x,2),cummin(x,2))) assert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse'))) assert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse'))) assert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))

Columns 1 through 30 80 80 80 58 58 22 20 20 20 20 20 11 11 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 Columns 31 through 54 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Columns 1 through 30 80 93 91 58 85 22 20 61 68 34 52 11 15 4 28 40 11 84 86 76 68 44 10 64 64 64 18 10 2 28 Columns 31 through 54 41 35 75 63 90 93 47 13 13 8 84 17 27 20 85 60 6 79 74 85 28 16 58 77 Columns 1 through 30 80 80 80 58 58 22 20 20 20 20 20 11 11 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 Columns 31 through 54 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Columns 1 through 30 80 93 91 58 85 22 20 61 68 34 52 11 15 4 28 40 11 84 86 76 68 44 10 64 64 64 18 10 2 28 Columns 31 through 54 41 35 75 63 90 93 47 13 13 8 84 17 27 20 85 60 6 79 74 85 28 16 58 77 Columns 1 through 30 77 58 16 16 16 16 16 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 2 2 2 2 2 Columns 31 through 54 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

Assertion failed.

5   Fail
x = magic(10); assert(isequal(cumin(x),cummin(x))) assert(isequal(cumin(x,1),cummin(x,1))) assert(isequal(cumin(x,2),cummin(x,2))) assert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse'))) assert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse'))) assert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))

92 99 1 8 15 67 74 51 58 40 92 80 1 8 15 67 55 51 58 40 4 80 1 8 15 54 55 51 58 40 4 80 1 8 3 54 55 51 58 28 4 80 1 2 3 54 55 51 52 28 4 24 1 2 3 42 49 26 33 28 4 5 1 2 3 42 30 26 33 28 4 5 1 2 3 29 30 26 33 28 4 5 1 2 3 29 30 26 33 28 4 5 1 2 3 29 30 26 27 28 92 99 1 8 15 67 74 51 58 40 92 80 1 8 15 67 55 51 58 40 4 80 1 8 15 54 55 51 58 40 4 80 1 8 3 54 55 51 58 28 4 80 1 2 3 54 55 51 52 28 4 24 1 2 3 42 49 26 33 28 4 5 1 2 3 42 30 26 33 28 4 5 1 2 3 29 30 26 33 28 4 5 1 2 3 29 30 26 33 28 4 5 1 2 3 29 30 26 27 28 92 92 1 1 1 1 1 1 1 1 98 80 7 7 7 7 7 7 7 7 4 4 4 4 4 4 4 4 4 4 85 85 19 19 3 3 3 3 3 3 86 86 25 2 2 2 2 2 2 2 17 17 17 17 17 17 17 17 17 17 23 5 5 5 5 5 5 5 5 5 79 6 6 6 6 6 6 6 6 6 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 18 100 77 84 36 43 50 27 59 10 12 94 77 78 35 37 44 27 53 10 6 13 77 78 29 31 38 27 53 10 5 13 77 78 29 30 32 27 53 10 5 13 77 78 29 30 26 27 53 10 5 13 2 9 29 30 26 27 34 10 5 13 2 3 29 30 26 27 28 4 5 13 2 3 29 30 26 27 28 4 5 7 2 3 29 30 26 27 28 4 5 1 2 3 29 30 26 27 28

Assertion failed.

6   Pass
x = []; assert(isequal(cumin(x),cummin(x))) assert(isequal(cumin(x,1),cummin(x,1))) assert(isequal(cumin(x,2),cummin(x,2))) assert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse'))) assert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse'))) assert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))