Cody

Solution 1868537

Submitted on 8 Jul 2019 by Steafan Khan
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 tf = logical 1

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

a = [] tf = logical 1

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

a = 0 0 0 0 tf = logical 0

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

a = 1 1 1 -7 tf = logical 0

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

a = -1 6 1 1 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 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.5560 0.7681 0.9432 -3.4438 3.7944 0.3669 0.3154 0.0214 0.5319 0.4847 0.5057 0.1547 0.8742 0.3708 0.1990 0.1898 0.4612 0.3277 Columns 19 through 36 0.2833 0.4260 0.1204 0.2156 0.1931 0.5363 0.2293 0.0529 0.0676 0.8705 0.4583 0.4598 0.6227 0.2445 0.4791 0.3930 0.5671 0.9027 Columns 37 through 54 0.3752 0.9211 0.9369 0.4640 0.6250 0.0909 0.6917 0.3898 0.7046 0.0663 0.9317 0.6054 0.3292 0.2910 0.1895 0.8605 0.6243 0.9259 Columns 55 through 72 0.0996 0.2682 0.4089 0.3541 0.2557 0.7749 0.6476 0.6515 0.9231 0.3193 0.2008 0.2151 0.6085 0.7385 0.5425 0.5312 0.3813 0.8966 Columns 73 through 90 0.9481 0.1373 0.3748 0.7919 0.8257 0.5523 0.2457 0.2213 0.0447 0.4530 0.4773 0.5470 0.5552 0.2196 0.2371 0.5706 0.4881 0.5056 Columns 91 through 99 0.2524 0.1281 0.4828 0.1811 0.3832 0.5657 0.0906 0.9347 0.6508 tf = logical 0

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

a = Columns 1 through 18 0.3533 0.4635 0.0587 0.4706 0.0749 0.4374 0.6646 0.9326 0.2017 0.8055 0.8998 0.7851 0.5843 0.4823 0.0459 0.7617 0.3479 0.2717 Columns 19 through 36 0.8190 0.2045 0.7554 0.4134 0.8881 0.5432 0.7301 0.5108 0.2810 0.9653 0.6540 0.6656 0.3675 0.5122 0.2487 0.8151 0.1407 0.3986 Columns 37 through 49 0.2966 0.3941 0.9976 0.0195 0.4091 0.6995 0.8224 0.4154 0.8421 0.1987 0.8777 0.6571 0.1428 tf = logical 1

Suggested Problems

More from this Author95