Cody

Solution 121566

Submitted on 1 Aug 2012 by Falko Schindler
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.6290 0.5125 0.1446 0.8220 0.5713

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

ans = Columns 1 through 6 0.6278 0.3445 0.9736 0.4543 0.2619 0.4226 Columns 7 through 12 0.1326 0.3742 0.3822 0.7601 0.2113 0.6060 Columns 13 through 18 0.7572 0.1692 0.7363 0.4599 0.3364 0.4650 Columns 19 through 24 0.7805 0.1388 0.8757 0.6994 0.7225 0.0867 Columns 25 through 30 0.8477 0.6135 0.0815 0.5165 0.5487 0.8547 Columns 31 through 36 0.0970 0.1399 0.5318 0.6911 0.0893 0.7782 Columns 37 through 42 0.6165 0.2098 0.4246 0.1786 0.5899 0.3111 Columns 43 through 48 0.6122 0.2037 0.3487 0.5579 0.4267 0.9913 Columns 49 through 50 0.1787 0.2654

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