Cody

Solution 1270722

Submitted on 18 Sep 2017 by safa osman
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.3898 0.9399 0.0349 0.5075 0.3011

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.3882 0.5886 0.8251 0.1229 0.3036 0.8012 0.5486 0.5842 0.4474 0.2552 0.5414 0.4578 0.9506 0.0165 0.3747 0.4206 0.2097 0.4146 Columns 19 through 36 0.6728 0.8228 0.1156 0.7399 0.6547 0.2155 0.6455 0.8196 0.9523 0.0696 0.7208 0.7282 0.2132 0.1068 0.1049 0.3091 0.8750 0.4852 Columns 37 through 50 0.6617 0.4254 0.8852 0.8714 0.7828 0.4606 0.5939 0.5806 0.5356 0.6788 0.7341 0.2612 0.1047 0.7294

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'