Cody

Solution 580110

Submitted on 11 Feb 2015 by Alfonso Nieto-Castanon
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   Pass
%% y = 2; assert(isequal(odd_fcn(y),0)) assert(isequal(even_fcn(y),1))

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

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

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

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

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

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

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

Suggested Problems

More from this Author45