Cody

Solution 199299

Submitted on 1 Feb 2013 by Thijs
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.2512 0.0562 0.2326 0.2039 0.5517

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

ans = Columns 1 through 10 0.9968 0.4915 0.3392 0.6255 0.5367 0.8143 0.7192 0.2435 0.5555 0.4202 Columns 11 through 20 0.1418 0.4067 0.4518 0.7708 0.7711 0.0717 0.2897 0.9267 0.5237 0.8870 Columns 21 through 30 0.9120 0.6283 0.2275 0.7197 0.2671 0.7992 0.5599 0.3712 0.6903 0.0608 Columns 31 through 40 0.8290 0.9513 0.3691 0.9011 0.4796 0.4047 0.2016 0.4152 0.1423 0.3987 Columns 41 through 50 0.5505 0.3780 0.8149 0.4794 0.7561 0.1988 0.9675 0.4934 0.9278 0.9082

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