Cody

Solution 2207777

Submitted on 13 Apr 2020 by madhu vamsi karicharla
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   Pass
x = [0 1 2 3 -4]; assert(isequal(mono_increase(x),false));

y = -4 0 1 2 3

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

y = -4 -3 2 3 4

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

y = Columns 1 through 17 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 Columns 18 through 34 2.7000 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 Columns 35 through 51 4.4000 4.5000 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 Columns 52 through 68 6.1000 6.2000 6.3000 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 Columns 69 through 85 7.8000 7.9000 8.0000 8.1000 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 Columns 86 through 91 9.5000 9.6000 9.7000 9.8000 9.9000 10.0000

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

y = Columns 1 through 17 -1.0000 0.2543 0.9023 1.3514 1.9938 3.1351 3.5405 3.9436 4.0412 4.4163 5.2874 5.7445 5.7844 6.7042 7.4687 7.9998 8.2328 Columns 18 through 34 9.1999 9.3311 9.6994 10.1536 10.4310 11.1206 11.9002 12.1721 12.9770 13.3957 13.4885 14.3305 15.2499 16.0124 16.9959 17.4281 17.6371 Columns 35 through 51 17.7628 18.4941 18.6833 19.0374 19.3596 19.7788 20.7167 21.1388 21.1687 21.1986 22.0215 22.1504 22.2335 23.2194 23.4678 23.7672 24.4721 Columns 52 through 68 24.5250 24.5633 24.6683 25.2462 25.3900 26.1655 26.5587 26.8100 27.2012 27.2304 27.7296 28.2790 28.6014 28.7774 29.4172 29.8221 30.5691 Columns 69 through 85 30.8535 31.3362 31.8878 32.6526 33.4673 33.7886 34.1922 34.6656 35.6163 36.0937 37.0335 37.5150 38.1228 38.7411 39.0856 39.3806 39.8499 Columns 86 through 100 39.9001 40.6986 40.8825 41.4632 42.0559 43.0300 43.4332 44.2565 44.8281 45.6574 46.0612 46.3774 46.7105 47.2125 47.9929

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

y = Columns 1 through 17 0.6410 0.9474 0.9607 1.3670 1.9579 2.4282 2.6451 2.8523 3.4001 3.7809 4.5662 4.8090 5.4831 5.5359 6.4606 6.6982 7.4341 Columns 18 through 34 8.0962 8.4949 8.6334 9.2151 9.2374 10.1573 10.4383 11.3004 12.0892 12.1823 12.5399 13.4854 14.3258 14.9100 15.6557 15.8736 15.9116 Columns 35 through 50 15.9585 16.5651 17.2622 17.4951 17.7592 18.1231 18.5632 19.0068 19.0629 19.4754 20.4311 20.8151 21.3865 21.9738 22.7264 22.8586

Suggested Problems

More from this Author95