Cody

Solution 246908

Submitted on 20 May 2013 by Eilif
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))

ind = 2 4 6 8 y = 0.3737 0.9919 0.0714 0.7332 0.2757

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

ind = Columns 1 through 16 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 Columns 17 through 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 Columns 33 through 48 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 Column 49 98 y = Columns 1 through 10 0.4547 0.9361 0.4813 0.2916 0.3660 0.0655 0.8213 0.2949 0.0574 0.6643 Columns 11 through 20 0.7292 0.6268 0.1448 0.0759 0.4923 0.3935 0.2302 0.8710 0.4279 0.8325 Columns 21 through 30 0.1500 0.0562 0.3685 0.2591 0.9399 0.2199 0.5272 0.8486 0.8016 0.4505 Columns 31 through 40 0.4633 0.5274 0.8283 0.1416 0.1460 0.7924 0.0855 0.6653 0.0458 0.9064 Columns 41 through 50 0.1611 0.6495 0.4978 0.9138 0.7288 0.6882 0.8641 0.0517 0.7862 0.3046

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

ind = 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 y = Aogiegiaaayafrwy

Suggested Problems