Cody

Solution 1791121

Submitted on 16 Apr 2019 by Brendan Stoll
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.4831 0.6331 0.5001 0.9325 0.6679

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

ans = Columns 1 through 18 0.2955 0.3784 0.5272 0.7671 0.2096 0.8661 0.4831 0.2811 0.9403 0.9733 0.9889 0.7393 0.5665 0.1619 0.2140 0.9696 0.8049 0.9531 Columns 19 through 36 0.7675 0.6190 0.0040 0.5270 0.4672 0.6082 0.3222 0.2461 0.2015 0.6985 0.6471 0.4075 0.5293 0.2459 0.6353 0.7322 0.6272 0.6369 Columns 37 through 50 0.0985 0.1998 0.2749 0.0873 0.3526 0.3349 0.5736 0.0829 0.1233 0.6620 0.6478 0.8140 0.1962 0.6891

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'

Suggested Problems

More from this Author95