Cody

# Problem 3004. Two functions (to be sure)

Solution 2912521

Submitted on 4 Sep 2020
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 = 1; assert(isequal(odd_fcn(x),1)) assert(isequal(even_fcn(x),0))

2   Fail
y = 2; assert(isequal(odd_fcn(y),0)) assert(isequal(even_fcn(y),1))

Assertion failed.

3   Fail
x = [1 2]; assert(isequal(odd_fcn(x),1)) assert(isequal(even_fcn(x),1))

Assertion failed.

4   Fail
x = 1:10; assert(isequal(odd_fcn(x),5)) assert(isequal(even_fcn(x),5))

Assertion failed.

5   Fail
x = 1:100; assert(isequal(odd_fcn(x),50)) assert(isequal(even_fcn(x),50))

Assertion failed.

6   Fail
x=(2:2:1000)'; assert(isequal(odd_fcn(x),0)) assert(isequal(even_fcn(x),500))

Assertion failed.

7   Fail
x = [1:2:10000]; assert(isequal(odd_fcn(x),5000)) assert(isequal(even_fcn(x),0))

Assertion failed.

8   Fail
x = [2 1:2:10000]; assert(isequal(odd_fcn(x),5000)) assert(isequal(even_fcn(x),1))

Assertion failed.

9   Fail
x = [1 2 3;4 5 6;7 8 9]; assert(isequal(odd_fcn(x),5)) assert(isequal(even_fcn(x),4))

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!