Cody

Solution 580705

Submitted on 12 Feb 2015 by Abdullah Caliskan
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))

K = 1

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

K = 0

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

K = 1

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

K = 5

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

K = 50

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

K = 0

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

K = 5000

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

K = 5000

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

K = 5