Cody

Solution 1524691

Submitted on 10 May 2018 by naixin mu
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))

y = 0.2713 0.4506 0.4187 0.3927 0.4386

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

y = Columns 1 through 18 0.2813 0.3333 0.6011 0.5210 0.4057 0.3065 0.2394 0.6620 0.1964 0.1322 0.6408 0.8208 0.0758 0.2907 0.7885 0.5557 0.6096 0.8796 Columns 19 through 36 0.0587 0.9456 0.8561 0.8121 0.6602 0.3691 0.0763 0.4082 0.6952 0.3905 0.7328 0.6785 0.6593 0.5232 0.2659 0.9465 0.8957 0.8049 Columns 37 through 50 0.2561 0.9419 0.8764 0.0279 0.1705 0.5795 0.6959 0.5442 0.8848 0.3897 0.8267 0.8585 0.6720 0.4135

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))

y = 'Aogiegiaaayafrwy'