Cody

Solution 226469

Submitted on 2 Apr 2013 by Michael
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));

d = 1 1 1 1 ans = 1

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

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

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

d = 1 1 1 -7 ans = -7

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

d = -1 6 1 1 ans = -1

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

d = Columns 1 through 9 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 10 through 18 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 19 through 27 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 28 through 36 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 37 through 45 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 46 through 54 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 55 through 63 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 64 through 72 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 73 through 81 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 Columns 82 through 90 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 ans = 0.1000

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

d = Columns 1 through 9 0.1056 0.6110 0.7788 -2.8205 3.3348 0.2665 0.1537 0.2810 0.4401 Columns 10 through 18 0.5271 0.4574 0.8754 0.5181 0.9436 0.6377 0.9577 0.2407 0.6761 Columns 19 through 27 0.2891 0.6718 0.6951 0.0680 0.2548 0.2240 0.6678 0.8444 0.3445 Columns 28 through 36 0.7805 0.6753 0.0067 0.6022 0.3868 0.9160 0.0012 0.4624 0.4243 Columns 37 through 45 0.4609 0.7702 0.3225 0.7847 0.4714 0.0358 0.1759 0.7218 0.4735 Columns 46 through 54 0.1527 0.3411 0.6074 0.1917 0.7384 0.2428 0.9174 0.2691 0.7655 Columns 55 through 63 0.1887 0.2875 0.0911 0.5762 0.6834 0.5466 0.4257 0.6444 0.6476 Columns 64 through 72 0.6790 0.6358 0.9452 0.2089 0.7093 0.2362 0.1194 0.6073 0.4501 Columns 73 through 81 0.4587 0.6619 0.7703 0.3502 0.6620 0.4162 0.8419 0.8329 0.2564 Columns 82 through 90 0.6135 0.5822 0.5407 0.8699 0.2648 0.3181 0.1192 0.9398 0.6456 Columns 91 through 99 0.4795 0.6393 0.5447 0.6473 0.5439 0.7210 0.5225 0.9937 0.2187 ans = -2.8205

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

d = Columns 1 through 9 0.1097 0.0636 0.4046 0.4484 0.3658 0.7635 0.6279 0.7720 0.9329 Columns 10 through 18 0.9727 0.1920 0.1389 0.6963 0.0938 0.5254 0.5303 0.8611 0.4849 Columns 19 through 27 0.3935 0.6714 0.7413 0.5201 0.3477 0.1500 0.5861 0.2621 0.0445 Columns 28 through 36 0.7549 0.2428 0.4424 0.6878 0.3592 0.7363 0.3947 0.6834 0.7040 Columns 37 through 45 0.4423 0.0196 0.3309 0.4243 0.2703 0.1971 0.8217 0.4299 0.8878 Columns 46 through 49 0.3912 0.7691 0.3968 0.8085 ans = 0.0196