Cody

Solution 1271138

Submitted on 19 Sep 2017 by Medhat Urooj
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.9751 0.9367 0.9039 0.0702 0.8377

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

ans = Columns 1 through 17 0.8668 0.5097 0.0216 0.6760 0.0005 0.9386 0.1130 0.2724 0.5143 0.4124 0.1163 0.8560 0.6433 0.8448 0.1470 0.8372 0.8547 Columns 18 through 34 0.8251 0.5442 0.1143 0.1514 0.5510 0.6780 0.3936 0.2918 0.7977 0.8987 0.6259 0.8153 0.6023 0.6673 0.1884 0.2886 0.0187 Columns 35 through 50 0.0235 0.0204 0.5424 0.9821 0.3969 0.9632 0.3407 0.6282 0.0406 0.7110 0.6668 0.9132 0.5388 0.8509 0.4173 0.9813

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'