Cody

Solution 2084599

Submitted on 9 Jan 2020 by Jack Hoayun
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 1 1 1 tf = logical 1

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

y = [] tf = logical 1

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

y = 0 0 0 0 tf = logical 0

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

y = 1 1 1 -7 tf = logical 0

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

y = -1 6 1 1 tf = logical 0

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

y = 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));

y = Columns 1 through 18 0.9506 0.4497 0.5549 -3.8509 4.2594 0.5771 0.0688 0.4098 0.5885 0.0272 0.3910 0.9088 0.0387 0.9453 0.4981 0.8643 0.8903 0.1333 Columns 19 through 36 0.8859 0.2102 0.0084 0.7534 0.6978 0.6786 0.0189 0.6403 0.9140 0.7926 0.4039 0.6164 0.9441 0.8869 0.3295 0.2634 0.1284 0.5911 Columns 37 through 54 0.1857 0.8561 0.6102 0.7663 0.8830 0.4398 0.3728 0.4206 0.5096 0.7562 0.7334 0.0079 0.3841 0.6780 0.9557 0.1221 0.9870 0.7281 Columns 55 through 72 0.4868 0.2806 0.8517 0.6085 0.8322 0.9066 0.9904 0.5150 0.2049 0.3625 0.2492 0.1699 0.1255 0.4314 0.7572 0.7495 0.0052 0.4194 Columns 73 through 90 0.0114 0.8097 0.8521 0.4525 0.9366 0.7262 0.9871 0.1221 0.6149 0.4012 0.2771 0.2348 0.1506 0.4232 0.7924 0.1850 0.5192 0.6702 Columns 91 through 99 0.2151 0.0600 0.5291 0.9101 0.4539 0.2764 0.1656 0.0857 0.9308 tf = logical 0

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

y = Columns 1 through 18 0.2062 0.5972 0.5061 0.7996 0.9087 0.0963 0.4595 0.9378 0.3528 0.7799 0.8830 0.6666 0.6154 0.9627 0.3550 0.4036 0.5593 0.3086 Columns 19 through 36 0.3403 0.7694 0.1731 0.3548 0.2799 0.0586 0.4416 0.5021 0.1306 0.5563 0.6771 0.4982 0.0517 0.2475 0.4991 0.2873 0.3809 0.1014 Columns 37 through 49 0.3428 0.6428 0.3941 0.7144 0.2104 0.9015 0.5553 0.1124 0.8478 0.2587 0.6860 0.8681 0.9527 tf = logical 1