Cody

Solution 2004733

Submitted on 6 Nov 2019 by Laura D'Alessandro
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));

a = 1 1 1 1 b = 1×4 logical array 1 1 1 1 c = 4 d = 4 tf = logical 1

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

a = [] b = 0×0 empty logical array c = 0 d = 0 tf = logical 1

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

a = 0 0 0 0 b = 1×4 logical array 0 0 0 0 c = 4 d = 0 tf = logical 0

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

a = 1 1 1 -7 b = 1×4 logical array 1 1 1 0 c = 4 d = 3 tf = logical 0

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

a = -1 6 1 1 b = 1×4 logical array 0 1 1 1 c = 4 d = 3 tf = logical 0

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

a = 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 b = 1×90 logical array Columns 1 through 45 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 46 through 90 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 c = 90 d = 90 tf = logical 1

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

a = Columns 1 through 18 0.8737 0.4588 0.0546 -2.5289 3.0787 0.2590 0.8546 0.1007 0.5821 0.9319 0.7611 0.0758 0.5697 0.2807 0.8809 0.4956 0.5764 0.2131 Columns 19 through 36 0.8751 0.9228 0.5388 0.1151 0.1344 0.9519 0.3450 0.9413 0.0935 0.5261 0.0070 0.0674 0.7289 0.2900 0.6315 0.1926 0.4526 0.7757 Columns 37 through 54 0.4269 0.9312 0.0908 0.2373 0.6500 0.6882 0.2309 0.3701 0.4043 0.2448 0.8842 0.2450 0.3725 0.4460 0.9916 0.5210 0.9484 0.3893 Columns 55 through 72 0.5637 0.6189 0.2061 0.2674 0.0969 0.1238 0.0083 0.6395 0.5116 0.3602 0.4137 0.3475 0.8204 0.0392 0.5345 0.1181 0.6475 0.7529 Columns 73 through 90 0.6570 0.0780 0.4179 0.7951 0.5563 0.5830 0.9154 0.7177 0.7066 0.2973 0.8150 0.2854 0.5790 0.6498 0.2063 0.6022 0.3518 0.6821 Columns 91 through 99 0.2948 0.7714 0.2972 0.7261 0.6213 0.6556 0.9764 0.9996 0.9860 b = 1×99 logical array Columns 1 through 45 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 46 through 90 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 91 through 99 1 1 1 1 1 1 1 1 1 c = 99 d = 98 tf = logical 0

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

a = Columns 1 through 18 0.4327 0.3147 0.8805 0.7966 0.6496 0.8893 0.6830 0.2254 0.6260 0.1912 0.6834 0.2690 0.1008 0.3052 0.6657 0.7008 0.9835 0.4581 Columns 19 through 36 0.3454 0.8915 0.2286 0.3760 0.8891 0.6305 0.3150 0.7635 0.0101 0.7897 0.2545 0.0845 0.0399 0.3157 0.0725 0.1233 0.5953 0.3287 Columns 37 through 49 0.4250 0.1970 0.2242 0.9770 0.7425 0.7986 0.4479 0.1662 0.5013 0.0865 0.8316 0.9347 0.5354 b = 1×49 logical array Columns 1 through 45 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 46 through 49 1 1 1 1 c = 49 d = 49 tf = logical 1