Cody

# Problem 10. Determine whether a vector is monotonically increasing

Solution 2049350

Submitted on 6 Dec 2019 by rose
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));

s = 5 n = 1 tf = logical 1 tf = logical 1 n = 2 tf = logical 1 n = 3 tf = logical 1 n = 4 tf = logical 1 n = 5

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

s = 1 n = 1 tf = logical 1

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

s = 5 n = 1 tf = logical 1 tf = logical 0 n = 2

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

s = 5 n = 1 tf = logical 1 tf = logical 1 n = 2 tf = logical 1 n = 3 tf = logical 1 n = 4 tf = logical 0 n = 5

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

s = 5 n = 1 tf = logical 1 tf = logical 0 n = 2

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

s = 91 n = 1 tf = logical 1 tf = logical 1 n = 2 tf = logical 1 n = 3 tf = logical 1 n = 4 tf = logical 1 n = 5 tf = logical 1 n = 6 tf = logical 1 n = 7 tf = logical 1 n = 8 tf = logical 1 n = 9 tf = logical 1 n = 10 tf = logical 1 n = 11 tf = logical 1 n = 12 tf = logical 1 n = 13 tf = logical 1 n = 14 tf = logical 1 n = 15 tf = logical 1 n = 16 tf = logical 1 n = 17 tf = logical 1 n = 18 tf = logical 1 n = 19 tf = logical 1 n = 20 tf = logical 1 n = 21 tf = logical 1 n = 22 tf = logical 1 n = 23 tf = logical 1 n = 24 tf = logical 1 n = 25 tf = logical 1 n = 26 tf = logical 1 n = 27 tf = logical 1 n = 28 tf = logical 1 n = 29 tf = logical 1 n = 30 tf = logical 1 n = 31 tf = logical 1 n = 32 tf = logical 1 n = 33 tf = logical 1 n = 34 tf = logical 1 n = 35 tf = logical 1 n = 36 tf = logical 1 n = 37 tf = logical 1 n = 38 tf = logical 1 n = 39 tf = logical 1 n = 40 tf = logical 1 n = 41 tf = logical 1 n = 42 tf = logical 1 n = 43 tf = logical 1 n = 44 tf = logical 1 n = 45 tf = logical 1 n = 46 tf = logical 1 n = 47 tf = logical 1 n = 48 tf = logical 1 n = 49 tf = logical 1 n = 50 tf = logical 1 n = 51 tf = logical 1 n = 52 tf = logical 1 n = 53 tf = logical 1 n = 54 tf = logical 1 n = 55 tf = logical 1 n = 56 tf = logical 1 n = 57 tf = logical 1 n = 58 tf = logical 1 n = 59 tf = logical 1 n = 60 tf = logical 1 n = 61 tf = logical 1 n = 62 tf = logical 1 n = 63 tf = logical 1 n = 64 tf = logical 1 n = 65 tf = logical 1 n = 66 tf = logical 1 n = 67 tf = logical 1 n = 68 tf = logical 1 n = 69 tf = logical 1 n = 70 tf = logical 1 n = 71 tf = logical 1 n = 72 tf = logical 1 n = 73 tf = logical 1 n = 74 tf = logical 1 n = 75 tf = logical 1 n = 76 tf = logical 1 n = 77 tf = logical 1 n = 78 tf = logical 1 n = 79 tf = logical 1 n = 80 tf = logical 1 n = 81 tf = logical 1 n = 82 tf = logical 1 n = 83 tf = logical 1 n = 84 tf = logical 1 n = 85 tf = logical 1 n = 86 tf = logical 1 n = 87 tf = logical 1 n = 88 tf = logical 1 n = 89 tf = logical 1 n = 90 tf = logical 1 n = 91

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

s = 100 n = 1 tf = logical 1 tf = logical 1 n = 2 tf = logical 1 n = 3 tf = logical 1 n = 4 tf = logical 0 n = 5

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

s = 50 n = 1 tf = logical 1 tf = logical 1 n = 2 tf = logical 1 n = 3 tf = logical 1 n = 4 tf = logical 1 n = 5 tf = logical 1 n = 6 tf = logical 1 n = 7 tf = logical 1 n = 8 tf = logical 1 n = 9 tf = logical 1 n = 10 tf = logical 1 n = 11 tf = logical 1 n = 12 tf = logical 1 n = 13 tf = logical 1 n = 14 tf = logical 1 n = 15 tf = logical 1 n = 16 tf = logical 1 n = 17 tf = logical 1 n = 18 tf = logical 1 n = 19 tf = logical 1 n = 20 tf = logical 1 n = 21 tf = logical 1 n = 22 tf = logical 1 n = 23 tf = logical 1 n = 24 tf = logical 1 n = 25 tf = logical 1 n = 26 tf = logical 1 n = 27 tf = logical 1 n = 28 tf = logical 1 n = 29 tf = logical 1 n = 30 tf = logical 1 n = 31 tf = logical 1 n = 32 tf = logical 1 n = 33 tf = logical 1 n = 34 tf = logical 1 n = 35 tf = logical 1 n = 36 tf = logical 1 n = 37 tf = logical 1 n = 38 tf = logical 1 n = 39 tf = logical 1 n = 40 tf = logical 1 n = 41 tf = logical 1 n = 42 tf = logical 1 n = 43 tf = logical 1 n = 44 tf = logical 1 n = 45 tf = logical 1 n = 46 tf = logical 1 n = 47 tf = logical 1 n = 48 tf = logical 1 n = 49 tf = logical 1 n = 50