Cody

Solution 1820209

Submitted on 20 May 2019 by Aryeh Samoka
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 = 1 1 1 1 tf = logical 1

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

S = 1×0 empty double row vector tf = logical 1

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

S = 0 0 0 0 tf = logical 0

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

S = 1 1 1 -7 tf = logical 0

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

S = -1 6 1 1 tf = logical 0

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

S = 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 tf = logical 1

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

S = Columns 1 through 18 0.3108 0.6486 0.1631 -2.6036 3.8563 0.2910 0.7608 0.2758 0.7704 0.3112 0.3778 0.0854 0.7760 0.3081 0.3140 0.6512 0.0731 0.6404 Columns 19 through 36 0.5040 0.2113 0.4047 0.6912 0.5033 0.4933 0.7176 0.4247 0.3930 0.0946 0.1968 0.5155 0.3919 0.4832 0.7214 0.3975 0.4693 0.9468 Columns 37 through 54 0.2646 0.8640 0.4080 0.4438 0.7729 0.8419 0.4635 0.9842 0.5056 0.7014 0.2710 0.0658 0.0496 0.7209 0.9776 0.0037 0.1597 0.7060 Columns 55 through 72 0.1864 0.0764 0.8785 0.8740 0.5432 0.1782 0.0636 0.1655 0.1610 0.4800 0.7450 0.6859 0.1809 0.0128 0.6705 0.7033 0.9190 0.4784 Columns 73 through 90 0.0999 0.0160 0.3868 0.7953 0.1028 0.6948 0.2864 0.1180 0.8638 0.6267 0.1189 0.7549 0.4882 0.3129 0.0105 0.2548 0.8993 0.3811 Columns 91 through 99 0.7786 0.7564 0.2967 0.2720 0.1113 0.6951 0.7209 0.9085 0.9919 tf = logical 0

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

S = Columns 1 through 18 0.2306 0.3349 0.6164 0.9434 0.5899 0.9855 0.6191 0.8778 0.6845 0.9205 0.5172 0.4386 0.7885 0.4869 0.6983 0.7363 0.1992 0.2901 Columns 19 through 36 0.4252 0.0383 0.8738 0.2327 0.5989 0.2540 0.6721 0.7164 0.8936 0.9009 0.0397 0.1085 0.8017 0.4497 0.1328 0.8415 0.6598 0.1201 Columns 37 through 49 0.7971 0.9273 0.6677 0.5819 0.7874 0.2197 0.7277 0.4917 0.6906 0.1071 0.0610 0.6203 0.7642 tf = logical 1