Cody

Solution 519823

Submitted on 3 Nov 2014 by Joshua
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.6659 0.4293 0.0238 0.4763 0.9797

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

y = Columns 1 through 9 0.5048 0.3991 0.5847 0.4737 0.1099 0.6459 0.4517 0.3522 0.5230 Columns 10 through 18 0.3245 0.2132 0.3886 0.8894 0.9080 0.1878 0.8614 0.1164 0.0257 Columns 19 through 27 0.3718 0.1899 0.0978 0.2715 0.8226 0.4805 0.3820 0.4437 0.2218 Columns 28 through 36 0.3764 0.7832 0.2604 0.1454 0.4712 0.0669 0.1741 0.3414 0.6768 Columns 37 through 45 0.4223 0.0847 0.4672 0.4558 0.6594 0.6991 0.2727 0.6091 0.4878 Columns 46 through 50 0.6008 0.1168 0.9060 0.3425 0.8795

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