Cody

Solution 182938

Submitted on 29 Dec 2012 by Niraj Poudel
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.2173 0.2750 0.1386 0.2032 0.5085

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

y = Columns 1 through 9 0.4719 0.6231 0.4618 0.6554 0.9802 0.2696 0.3324 0.2376 0.8671 Columns 10 through 18 0.4266 0.6488 0.4463 0.3773 0.5933 0.9866 0.6757 0.2684 0.7548 Columns 19 through 27 0.4526 0.7012 0.4230 0.2944 0.9096 0.4678 0.4863 0.0509 0.4334 Columns 28 through 36 0.8814 0.0569 0.6280 0.3913 0.2836 0.6567 0.4184 0.2615 0.6953 Columns 37 through 45 0.3065 0.8863 0.5442 0.8039 0.9709 0.1552 0.7676 0.0641 0.8538 Columns 46 through 50 0.5725 0.5934 0.6066 0.2657 0.2674

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