Cody

Solution 509873

Submitted on 7 Oct 2014 by Yusuf Shaaban
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.6200 0.4730 0.5264 0.5043 0.7950

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.8868 0.0074 0.6635 0.8035 0.2770 0.9420 0.8942 0.5246 0.8379 Columns 10 through 18 0.1219 0.4252 0.7280 0.4221 0.0338 0.4536 0.4570 0.6251 0.5268 Columns 19 through 27 0.7252 0.3022 0.7311 0.9516 0.9973 0.0234 0.6110 0.5205 0.8692 Columns 28 through 36 0.1929 0.1495 0.7463 0.2750 0.8846 0.1949 0.7597 0.5291 0.7102 Columns 37 through 45 0.6001 0.6301 0.8964 0.7576 0.3544 0.3508 0.0320 0.6875 0.4297 Columns 46 through 50 0.8417 0.0533 0.5315 0.0314 0.8466

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