Cody

Solution 340252

Submitted on 26 Oct 2013 by Anil
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.0976 0.1092 0.2603 0.3789 0.9129

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

y = Columns 1 through 10 0.3739 0.4289 0.8960 0.9021 0.7961 0.5656 0.6661 0.3595 0.7359 0.0441 Columns 11 through 20 0.3113 0.7925 0.8253 0.5497 0.0902 0.2855 0.0192 0.7140 0.9304 0.7368 Columns 21 through 30 0.4239 0.7700 0.1850 0.1727 0.2891 0.0528 0.3104 0.0558 0.2990 0.6334 Columns 31 through 40 0.1438 0.0390 0.9897 0.6456 0.0066 0.7839 0.8001 0.5812 0.2981 0.1558 Columns 41 through 50 0.9373 0.1919 0.0497 0.7782 0.7375 0.4247 0.6751 0.1522 0.3656 0.8356

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