Cody

Solution 219675

Submitted on 20 Mar 2013 by Adrien
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.4795 0.5447 0.5439 0.5225 0.2187

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.1097 0.4046 0.3658 0.6279 0.9329 0.1920 0.6963 0.5254 0.8611 Columns 10 through 18 0.3935 0.7413 0.3477 0.5861 0.0445 0.2428 0.6878 0.7363 0.6834 Columns 19 through 27 0.4423 0.3309 0.2703 0.8217 0.8878 0.7691 0.8085 0.3774 0.7904 Columns 28 through 36 0.3276 0.4386 0.7689 0.8620 0.5144 0.5880 0.1999 0.7487 0.7900 Columns 37 through 45 0.5341 0.1117 0.6787 0.1897 0.1476 0.8507 0.9296 0.5828 0.8790 Columns 46 through 50 0.0005 0.6126 0.5277 0.8013 0.4981

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