Cody

Solution 177763

Submitted on 15 Dec 2012 by Roberts
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))

y = 0.6991 0.9593 0.1386 0.2575 0.2543

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

y = Columns 1 through 10 0.2435 0.3500 0.2511 0.4733 0.8308 0.5497 0.2858 0.7537 0.5678 0.0540 Columns 11 through 20 0.7792 0.1299 0.4694 0.3371 0.7943 0.5285 0.6020 0.6541 0.7482 0.0838 Columns 21 through 30 0.9133 0.8258 0.9961 0.4427 0.9619 0.7749 0.8687 0.3998 0.8001 0.9106 Columns 31 through 40 0.2638 0.1361 0.5797 0.1450 0.6221 0.5132 0.0760 0.1233 0.2400 0.0497 Columns 41 through 50 0.9448 0.4893 0.9001 0.1112 0.3897 0.4039 0.1320 0.9561 0.0598 0.3532

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

y = Aogiegiaaayafrwy