Cody

Solution 202671

Submitted on 11 Feb 2013 by Nonya
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 = rand(1,10); actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

j = 0 j = 1 j = 2 j = 3 j = 4 j = 5

2   Pass
%% x = rand(1,100); actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

j = 0 j = 1 j = 2 j = 3 j = 4 j = 5 j = 6 j = 7 j = 8 j = 9 j = 10 j = 11 j = 12 j = 13 j = 14 j = 15 j = 16 j = 17 j = 18 j = 19 j = 20 j = 21 j = 22 j = 23 j = 24 j = 25 j = 26 j = 27 j = 28 j = 29 j = 30 j = 31 j = 32 j = 33 j = 34 j = 35 j = 36 j = 37 j = 38 j = 39 j = 40 j = 41 j = 42 j = 43 j = 44 j = 45 j = 46 j = 47 j = 48 j = 49 j = 50

3   Pass
%% x = ['A' 'long' 'time' 'ago' 'in' 'a' 'galaxy' 'far' 'far' 'away']; actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

j = 0 j = 1 j = 2 j = 3 j = 4 j = 5 j = 6 j = 7 j = 8 j = 9 j = 10 j = 11 j = 12 j = 13 j = 14 j = 15 j = 16