Cody

Solution 571257

Submitted on 1 Feb 2015 by Debopam
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; y_correct = 1; assert(isequal(oddsum(x),y_correct))

y = 0 i = 1 a = 1 b = 1 y = 1 i = 2

2   Pass
%% x = [2 3 5 7 1 4]; y_correct = 16; assert(isequal(oddsum(x),y_correct))

y = 0 i = 1 a = 1 b = 6 i = 2 y = 3 i = 3 y = 8 i = 4 y = 15 i = 5 y = 16 i = 6 i = 7

3   Pass
%% x = [2 3 5 7 1 4;9 1 5 8 3 2]; y_correct = 34; assert(isequal(oddsum(x),y_correct))

y = 0 i = 1 a = 2 b = 6

Suggested Problems

More from this Author9