Cody

Solution 1973677

Submitted on 13 Oct 2019 by Nikolaos Nikolaou
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));

f = 1 1 1 1 tf = logical 1

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

f = [] tf = logical 1

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

f = 0 0 0 0 tf = logical 1 tf = logical 0

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

f = 1 1 1 -7 tf = logical 0

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

f = -1 6 1 1 tf = logical 0

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

f = Columns 1 through 17 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 18 through 34 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 35 through 51 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 52 through 68 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 69 through 85 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 86 through 90 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));

f = Columns 1 through 17 0.9989 0.9106 0.3856 -3.9432 4.8037 0.2546 0.7313 0.3403 0.0360 0.6024 0.4277 0.7299 0.9397 0.7608 0.4780 0.4652 0.8541 Columns 18 through 34 0.5612 0.9135 0.4332 0.8532 0.6932 0.1187 0.4571 0.4298 0.8514 0.1985 0.1636 0.4698 0.4855 0.5386 0.4331 0.5469 0.3318 Columns 35 through 51 0.2985 0.8872 0.1497 0.1210 0.4334 0.7570 0.3854 0.5622 0.4021 0.3559 0.6026 0.7346 0.0825 0.2789 0.1519 0.6886 0.7600 Columns 52 through 68 0.9698 0.1030 0.2547 0.7098 0.9031 0.8865 0.1698 0.0359 0.7931 0.8007 0.2381 0.4747 0.9154 0.5845 0.9919 0.2273 0.3314 Columns 69 through 85 0.0550 0.5694 0.8731 0.4056 0.0500 0.4815 0.1231 0.3979 0.6653 0.2437 0.4351 0.1179 0.1067 0.2850 0.4778 0.4319 0.0614 Columns 86 through 99 0.9524 0.9561 0.0794 0.1793 0.1497 0.3838 0.8852 0.5066 0.8631 0.4769 0.5453 0.0680 0.0981 0.5461 tf = logical 0

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

f = Columns 1 through 17 0.5112 0.6856 0.2918 0.0481 0.4808 0.7448 0.6036 0.6173 0.2776 0.2408 0.9391 0.1774 0.4995 0.8476 0.5058 0.5410 0.4425 Columns 18 through 34 0.8433 0.3627 0.4262 0.0350 0.0149 0.2729 0.7418 0.4131 0.1733 0.2175 0.4901 0.7408 0.7667 0.8789 0.7961 0.3081 0.3433 Columns 35 through 49 0.8845 0.3761 0.5186 0.7980 0.0274 0.1234 0.9143 0.3458 0.6614 0.0693 0.8184 0.9937 0.5440 0.5430 0.7446 tf = logical 1