Cody

Solution 2108517

Submitted on 28 Jan 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   Pass
x = [0 1 2 3 4]; assert(isequal(mono_increase(x),true));

y = 0 1 2 3 4

2   Fail
x = [0]; assert(isequal(mono_increase(x),true));

y = 0

Assertion failed.

3   Pass
x = [0 0 0 0 0]; assert(isequal(mono_increase(x),false));

y = 0 0 0 0 0

4   Pass
x = [0 1 2 3 -4]; assert(isequal(mono_increase(x),false));

y = -4 0 1 2 3

5   Pass
x = [-3 -4 2 3 4]; assert(isequal(mono_increase(x),false));

y = -4 -3 2 3 4

6   Pass
x = 1:.1:10; assert(isequal(mono_increase(x),true));

y = Columns 1 through 18 1.0000 1.1000 1.2000 1.3000 1.4000 1.5000 1.6000 1.7000 1.8000 1.9000 2.0000 2.1000 2.2000 2.3000 2.4000 2.5000 2.6000 2.7000 Columns 19 through 36 2.8000 2.9000 3.0000 3.1000 3.2000 3.3000 3.4000 3.5000 3.6000 3.7000 3.8000 3.9000 4.0000 4.1000 4.2000 4.3000 4.4000 4.5000 Columns 37 through 54 4.6000 4.7000 4.8000 4.9000 5.0000 5.1000 5.2000 5.3000 5.4000 5.5000 5.6000 5.7000 5.8000 5.9000 6.0000 6.1000 6.2000 6.3000 Columns 55 through 72 6.4000 6.5000 6.6000 6.7000 6.8000 6.9000 7.0000 7.1000 7.2000 7.3000 7.4000 7.5000 7.6000 7.7000 7.8000 7.9000 8.0000 8.1000 Columns 73 through 90 8.2000 8.3000 8.4000 8.5000 8.6000 8.7000 8.8000 8.9000 9.0000 9.1000 9.2000 9.3000 9.4000 9.5000 9.6000 9.7000 9.8000 9.9000 Column 91 10.0000

7   Pass
x = cumsum(rand(1,100)); x(5) = -1; assert(isequal(mono_increase(x),false));

y = Columns 1 through 18 -1.0000 0.8364 0.8379 1.1217 1.5661 3.4947 3.8257 4.6899 4.8952 5.1244 5.7642 5.8467 6.1998 6.2349 6.7699 7.4514 8.3973 8.4317 Columns 19 through 36 8.4743 9.3053 10.0105 10.5754 11.5549 12.5332 12.9855 13.4912 13.9290 14.1959 15.1954 16.0156 16.7038 16.9945 17.4053 17.6574 18.4542 19.2136 Columns 37 through 54 19.4466 19.5028 20.2798 20.5415 20.8295 21.6264 22.0749 23.0558 23.3657 24.2836 24.7974 25.0104 25.4249 25.7393 26.4679 26.7012 27.4858 28.3657 Columns 55 through 72 28.4208 29.4088 29.9154 30.4403 31.0747 31.4364 31.8647 32.0452 32.9356 33.5263 34.2241 34.5036 34.7059 35.2626 35.3687 36.1516 36.7926 37.7718 Columns 73 through 90 38.2383 38.2651 38.3578 38.5584 39.1474 39.7190 40.6121 41.5356 41.7712 41.9846 42.0570 42.2297 43.2164 44.1277 44.2882 44.6428 45.3438 46.2460 Columns 91 through 100 46.9410 47.4585 48.1869 48.6954 49.5245 49.6319 50.5658 50.8586 51.1693 51.2983

8   Pass
x = cumsum(rand(1,50)); assert(isequal(mono_increase(x),true));

y = Columns 1 through 18 0.5022 0.5588 1.1333 1.8543 2.2301 2.5734 2.9322 3.0955 3.3802 3.4410 3.5084 3.7683 3.8319 4.0661 4.7127 5.0101 5.9871 6.3006 Columns 19 through 36 7.1727 8.1542 8.6467 8.8443 9.7084 10.4209 10.8538 11.6777 12.5340 13.3833 13.3912 14.1677 14.6405 15.3038 16.2346 16.9487 17.6785 18.4106 Columns 37 through 50 18.4420 18.8904 19.7038 20.2756 20.5551 21.3427 21.7463 21.9227 22.7997 23.7017 24.0901 24.1943 24.2517 24.3618