Cody

Solution 1944116

Submitted on 20 Sep 2019 at 13:10
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')))

27 27 16 16 16 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 27 27 16 16 16 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 27 40 16 19 88 10 72 100 70 34 11 74 33 22 54 24 66 69 47 39 4 96 58 88 85 37 71 73 35 15 29 11 67 67 20 14 78 37 95 72 47 77 59 59 59 47 47 47 37 37 14 14 14 14 11 11 11 11 11 11 11 11 11 11 11 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

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 51 51 26 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 1 through 30 51 52 26 2 26 37 36 77 90 89 5 1 94 87 34 48 74 5 21 82 28 93 17 54 85 97 7 60 89 43 Columns 31 through 49 82 98 48 7 5 69 81 87 84 43 82 73 7 70 65 23 4 25 93 Columns 1 through 30 51 51 26 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 1 through 30 51 52 26 2 26 37 36 77 90 89 5 1 94 87 34 48 74 5 21 82 28 93 17 54 85 97 7 60 89 43 Columns 31 through 49 82 98 48 7 5 69 81 87 84 43 82 73 7 70 65 23 4 25 93 Columns 1 through 30 93 25 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Columns 31 through 49 4 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 1

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')))