Cody

Solution 1794150

Submitted on 21 Apr 2019 by Riley Dehmer
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 = -1 0 1 2 3 4 dy = 1 1 1 1 1 1 tf = logical 1

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

y = -1 0 dy = 1 1 tf = logical 1

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

y = -1 0 0 0 0 0 dy = 1 0 0 0 0 1 tf = logical 0

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

y = -1 0 1 2 3 -4 dy = 1 1 1 1 -7 1 tf = logical 0

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

y = -4 -3 -4 2 3 4 dy = 1 -1 6 1 1 1 tf = logical 0

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

y = Columns 1 through 18 0 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 19 through 36 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 4.4000 Columns 37 through 54 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 6.1000 6.2000 Columns 55 through 72 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 7.8000 7.9000 8.0000 Columns 73 through 90 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 9.5000 9.6000 9.7000 9.8000 Columns 91 through 92 9.9000 10.0000 dy = Columns 1 through 18 1.0000 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 Columns 91 through 92 0.1000 1.0000 tf = logical 1

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

y = Columns 1 through 18 -0.5668 0.4332 1.3832 2.3776 3.0915 -1.0000 4.5606 5.3751 6.2475 6.7897 7.2878 7.9539 8.0203 8.0771 8.5349 8.9902 9.9482 10.0491 Columns 19 through 36 10.8361 11.6198 11.6540 12.5398 12.9905 13.6204 13.6720 14.6605 15.5861 16.5131 17.1691 18.1130 18.7985 19.7530 20.5492 20.9620 21.8370 22.6051 Columns 37 through 54 23.3906 23.9041 24.6793 25.5818 26.0339 26.9133 26.9279 27.4754 27.9598 28.8253 29.3344 29.4496 30.1255 30.7997 31.3355 32.0871 32.7347 33.1941 Columns 55 through 72 33.5234 34.1113 34.3643 35.3100 36.2543 36.5697 37.2268 37.5743 37.8038 37.8273 37.9550 38.0667 38.5420 39.2472 39.3065 40.0482 40.1733 40.9176 Columns 73 through 90 41.2323 41.3664 41.8445 42.1860 42.4621 43.0830 43.9375 44.4902 45.1901 45.2038 45.2441 45.8701 46.1539 46.1899 46.9698 47.5128 47.6357 48.5788 Columns 91 through 101 49.3546 50.2054 50.2997 51.1844 51.4163 51.5908 51.8428 52.3656 53.1551 53.4467 53.5247 dy = Columns 1 through 18 1.0000 0.9499 0.9945 0.7138 -4.0915 5.5606 0.8145 0.8724 0.5422 0.4981 0.6661 0.0664 0.0568 0.4579 0.4553 0.9580 0.1008 0.7870 Columns 19 through 36 0.7837 0.0342 0.8859 0.4507 0.6299 0.0516 0.9885 0.9256 0.9270 0.6560 0.9439 0.6855 0.9545 0.7963 0.4128 0.8750 0.7681 0.7855 Columns 37 through 54 0.5135 0.7752 0.9025 0.4521 0.8794 0.0146 0.5475 0.4844 0.8655 0.5091 0.1152 0.6759 0.6742 0.5358 0.7516 0.6476 0.4594 0.3294 Columns 55 through 72 0.5879 0.2530 0.9457 0.9443 0.3154 0.6570 0.3476 0.2294 0.0235 0.1276 0.1118 0.4752 0.7052 0.0594 0.7417 0.1251 0.7444 0.3147 Columns 73 through 90 0.1340 0.4781 0.3415 0.2761 0.6209 0.8544 0.5527 0.6999 0.0137 0.0403 0.6260 0.2838 0.0360 0.7799 0.5430 0.1229 0.9431 0.7758 Columns 91 through 101 0.8508 0.0943 0.8847 0.2319 0.1744 0.2521 0.5228 0.7895 0.2917 0.0780 1.0000 tf = logical 0

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

y = Columns 1 through 18 -0.0952 0.9048 1.1608 1.7584 2.5641 2.7578 2.8325 2.9100 3.2020 3.6282 3.7360 4.5861 5.4906 6.4091 7.3820 7.5486 8.0867 8.4035 Columns 19 through 36 8.6046 8.8283 9.8125 10.4953 10.9631 11.8789 12.6538 13.2962 13.7488 13.9010 14.0547 14.1390 15.0103 15.5721 15.7265 16.6001 17.4674 17.6710 Columns 37 through 51 18.5769 19.3517 20.0354 20.8450 21.2653 22.0234 22.0428 22.8551 23.7283 24.2828 24.7197 25.5640 25.9250 26.0407 26.2409 dy = Columns 1 through 18 1.0000 0.2561 0.5975 0.8058 0.1937 0.0747 0.0775 0.2919 0.4263 0.1078 0.8501 0.9045 0.9185 0.9730 0.1666 0.5380 0.3168 0.2011 Columns 19 through 36 0.2237 0.9843 0.6828 0.4678 0.9157 0.7750 0.6424 0.4526 0.1523 0.1536 0.0843 0.8713 0.5619 0.1543 0.8736 0.8673 0.2035 0.9060 Columns 37 through 51 0.7747 0.6837 0.8096 0.4204 0.7581 0.0194 0.8123 0.8732 0.5545 0.4369 0.8442 0.3611 0.1156 0.2002 1.0000 tf = logical 1