Cody

Solution 1540575

Submitted on 26 May 2018 by Zuxin Jin
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 = 1

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

y = [] tf = 1

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

y = 0 0 0 0

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

y = 1 1 1 -7

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

y = -1 6 1 1

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

y = 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 = 1

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

y = Columns 1 through 17 0.3240 0.0884 0.4513 -2.1894 2.6803 0.7994 0.4947 0.2576 0.3642 0.3933 0.6534 0.7173 0.6365 0.8433 0.4562 0.5372 0.0321 Columns 18 through 34 0.7985 0.4495 0.9516 0.0264 0.1242 0.1185 0.7450 0.3074 0.7136 0.7382 0.5918 0.3497 0.9970 0.6460 0.0283 0.3572 0.4293 Columns 35 through 51 0.6251 0.4498 0.2420 0.5529 0.7087 0.9945 0.4062 0.7388 0.6123 0.2192 0.8577 0.2639 0.7953 0.6728 0.5357 0.1918 0.2914 Columns 52 through 68 0.4211 0.8492 0.9821 0.1917 0.6124 0.8026 0.8380 0.4221 0.0141 0.0835 0.7844 0.1780 0.5471 0.0080 0.8415 0.7012 0.8731 Columns 69 through 85 0.2734 0.0627 0.4124 0.1573 0.3103 0.8068 0.0241 0.9799 0.9518 0.8044 0.2697 0.5352 0.2874 0.8330 0.2527 0.9144 0.3536 Columns 86 through 99 0.2289 0.0411 0.7618 0.0563 0.3017 0.9935 0.1388 0.6639 0.0336 0.3015 0.9473 0.3302 0.0672 0.4420

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

y = Columns 1 through 17 0.4342 0.5207 0.3747 0.8600 0.3635 0.0677 0.1935 0.6283 0.8445 0.8605 0.9218 0.1761 0.0189 0.2679 0.6604 0.0907 0.8885 Columns 18 through 34 0.9303 0.0040 0.8424 0.7407 0.2490 0.0636 0.1255 0.4600 0.7836 0.7136 0.8958 0.9896 0.9250 0.5645 0.8376 0.8662 0.8508 Columns 35 through 49 0.4198 0.6431 0.5163 0.7288 0.1202 0.0520 0.9311 0.6626 0.5727 0.4458 0.2017 0.7973 0.5976 0.9282 0.5515 tf = 1

Suggested Problems

More from this Author95