Cody

Solution 547230

Submitted on 17 Dec 2014 by Tarun Jhamnani
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.2034 0.6847 0.9987 0.6055 0.8136

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

ans = Columns 1 through 9 0.3495 0.0168 0.8697 0.0778 0.2429 0.9589 0.3292 0.1272 0.5949 Columns 10 through 18 0.0215 0.8693 0.2083 0.8336 0.7470 0.7193 0.8981 0.6837 0.8549 Columns 19 through 27 0.8107 0.2636 0.0976 0.3189 0.3119 0.8603 0.9266 0.8133 0.3614 Columns 28 through 36 0.7265 0.1504 0.5102 0.1057 0.0413 0.5042 0.6376 0.0154 0.2277 Columns 37 through 45 0.2386 0.0868 0.2575 0.7306 0.3308 0.7051 0.5727 0.7134 0.4001 Columns 46 through 50 0.1294 0.0665 0.4508 0.4304 0.8562

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