Cody

Solution 1825709

Submitted on 25 May 2019
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));

i = 1 j = 5 mat1 = 0 mat2 = 1

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

i = 1 j = 1 mat1 = 0

Index in position 2 exceeds array bounds (must not exceed 1). Error in mono_increase (line 17) mat2=x(1,2) Error in Test2 (line 2) assert(isequal(mono_increase(x),true));

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

i = 1 j = 5 mat1 = 0 mat2 = 0

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

i = 1 j = 5 mat1 = 0 mat2 = 1

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

i = 1 j = 5 mat1 = -3 mat2 = -4

Assertion failed.

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

i = 1 j = 91 mat1 = 1 mat2 = 1.1000

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

i = 1 j = 100 mat1 = 0.5870 mat2 = 0.6178

Assertion failed.

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

i = 1 j = 50 mat1 = 0.7662 mat2 = 1.5805

Suggested Problems

More from this Author95