Cody

Solution 312202

Submitted on 29 Aug 2013 by shantanu
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))

ans = 0.7485 0.8479 0.3375 0.1435 0.9086

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

ans = Columns 1 through 10 0.7444 0.1222 0.2081 0.4862 0.7165 0.7110 0.3139 0.8929 0.4966 0.8158 Columns 11 through 20 0.6047 0.7486 0.1934 0.4388 0.9303 0.7290 0.3618 0.5303 0.2099 0.4164 Columns 21 through 30 0.7307 0.3751 0.2172 0.0717 0.1096 0.0405 0.3512 0.4840 0.3182 0.0070 Columns 31 through 40 0.7677 0.5073 0.8733 0.9988 0.5081 0.3999 0.4277 0.1576 0.0589 0.8900 Columns 41 through 50 0.2025 0.5731 0.0888 0.7339 0.6158 0.8202 0.8099 0.0908 0.5470 0.1869

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

ans = Aogiegiaaayafrwy