Cody

Solution 1754968

Submitted on 19 Mar 2019 by David Pokorný
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));

d = 1 1 1 1 s = 1 1 1 1

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

d = [] s = []

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

d = 0 0 0 0 s = 0 0 0 0

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

d = 1 1 1 -7 s = 1 1 1 -1

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

d = -1 6 1 1 s = -1 1 1 1

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

d = Columns 1 through 18 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 19 through 36 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 37 through 54 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 55 through 72 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 73 through 90 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 60 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 61 through 90 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

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

d = Columns 1 through 18 0.1070 0.5660 0.0197 -2.2745 3.7768 0.1482 0.0092 0.2261 0.3594 0.8095 0.9226 0.9656 0.7393 0.4786 0.5768 0.8642 0.7927 0.8438 Columns 19 through 36 0.9697 0.5934 0.0651 0.0297 0.2057 0.9086 0.8917 0.9254 0.5842 0.8933 0.8699 0.9842 0.6464 0.1104 0.4776 0.2832 0.1105 0.5046 Columns 37 through 54 0.9134 0.1132 0.2408 0.1309 0.7565 0.2428 0.9993 0.5504 0.2022 0.7272 0.0490 0.3033 0.5717 0.5917 0.2795 0.5034 0.2067 0.7737 Columns 55 through 72 0.0014 0.5222 0.3088 0.4036 0.0907 0.2899 0.7433 0.0677 0.2928 0.8295 0.7197 0.4222 0.7162 0.8906 0.6607 0.3883 0.3999 0.2987 Columns 73 through 90 0.3549 0.5826 0.5733 0.3553 0.9491 0.7172 0.1986 0.9404 0.0326 0.3470 0.7455 0.6361 0.8564 0.4985 0.3714 0.4688 0.3263 0.9721 Columns 91 through 99 0.2300 0.6084 0.7589 0.3539 0.7644 0.1538 0.4573 0.4597 0.9830 s = Columns 1 through 30 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 31 through 60 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 61 through 90 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 91 through 99 1 1 1 1 1 1 1 1 1

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

d = Columns 1 through 18 0.7866 0.1856 0.7549 0.9746 0.0607 0.1346 0.1500 0.8253 0.7645 0.7738 0.3774 0.5369 0.0661 0.3889 0.8658 0.0558 0.2172 0.0653 Columns 19 through 36 0.8039 0.1825 0.6766 0.9450 0.0985 0.7882 0.7434 0.9195 0.0733 0.3152 0.1436 0.3309 0.0717 0.1754 0.4647 0.4850 0.2429 0.6059 Columns 37 through 49 0.2118 0.1597 0.8471 0.6308 0.9597 0.6347 0.2216 0.3738 0.7021 0.1182 0.1006 0.9834 0.0387 s = Columns 1 through 30 1 1 1 1 1 1 1 1 1 1 1 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

Suggested Problems

More from this Author95