Cody

Problem 10. Determine whether a vector is monotonically increasing

Solution 2682410

Submitted on 12 Jul 2020 by Sergio Enrique Pinto Castillo
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 = 5 mayor = 0 mayor = 1 mayor = 2 mayor = 3 mayor = 4 tf = logical 1

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

d = 5 mayor = 0 mayor = 1 mayor = 2 mayor = 3 tf = logical 0

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

d = 5 mayor = 0 mayor = 1 mayor = 2 mayor = 3 tf = logical 0

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

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

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

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

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

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

Suggested Problems

More from this Author95

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!