Cody

# Problem 3004. Two functions (to be sure)

Solution 1028226

Submitted on 23 Oct 2016
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   Fail
x = 1; assert(isequal(odd_fcn(x),1)) assert(isequal(even_fcn(x),0))

ans = 0

Undefined function 'even_fcn' for input arguments of type 'double'. Error in TestPoint1 (line 3) assert(isequal(even_fcn(x),0))

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

ans = 2

Assertion failed.

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

ans = 2

Undefined function 'even_fcn' for input arguments of type 'double'. Error in TestPoint3 (line 3) assert(isequal(even_fcn(x),1))

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

ans = 30

Assertion failed.

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

ans = 2550

Assertion failed.

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

ans = 250500

Assertion failed.

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

ans = 0

Assertion failed.

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

ans = 2

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))

ans = 20

Assertion failed.