Cody

Solution 240857

Submitted on 6 May 2013 by Garrie
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.2064 0.7091 0.4252 0.3224 0.2106

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.2083 0.2527 0.4818 0.3547 0.7498 0.6174 0.3025 0.8443 0.9088 0.6139 Columns 11 through 20 0.5081 0.0522 0.2187 0.6915 0.3596 0.3022 0.7961 0.7912 0.7395 0.9498 Columns 21 through 30 0.0196 0.9118 0.0713 0.0944 0.9155 0.0520 0.6912 0.8959 0.2320 0.8497 Columns 31 through 40 0.6622 0.8362 0.6506 0.1107 0.0164 0.9057 0.6442 0.6206 0.6458 0.6189 Columns 41 through 50 0.6692 0.4579 0.5231 0.7234 0.5907 0.5077 0.2909 0.1419 0.5931 0.4706

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