Cody

Solution 430379

Submitted on 11 Apr 2014 by Jean-François
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.3609 0.0679 0.0396 0.1501 0.4271

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.7242 0.5403 0.0050 0.9269 0.8246 0.9971 0.9195 0.1053 0.7638 Columns 10 through 18 0.1043 0.2191 0.3203 0.2598 0.1883 0.0317 0.5669 0.2125 0.1454 Columns 19 through 27 0.0128 0.4852 0.1411 0.6911 0.4889 0.1125 0.6385 0.4986 0.4265 Columns 28 through 36 0.2906 0.6333 0.9778 0.6617 0.4738 0.4756 0.9596 0.7977 0.9122 Columns 37 through 45 0.2933 0.5041 0.2830 0.3313 0.7374 0.3825 0.9653 0.1320 0.3830 Columns 46 through 50 0.2868 0.5352 0.6894 0.1844 0.8850

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