Cody

Solution 827896

Submitted on 15 Feb 2016 by nag
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.5239 0.7508 0.5872 0.1146 0.2544

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.1377 0.1385 0.9210 0.4174 0.3687 0.6113 0.4052 0.6325 0.2672 Columns 10 through 18 0.9747 0.3431 0.5555 0.2512 0.8469 0.6895 0.1514 0.5572 0.8336 Columns 19 through 27 0.9505 0.5112 0.9286 0.2705 0.3103 0.5669 0.0906 0.2985 0.6929 Columns 28 through 36 0.3214 0.7473 0.1476 0.6907 0.6372 0.4449 0.6032 0.6806 0.8127 Columns 37 through 45 0.0015 0.9759 0.9984 0.4763 0.5723 0.6027 0.9106 0.4880 0.3351 Columns 46 through 50 0.3897 0.9761 0.5062 0.1116 0.2513

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