Cody

Solution 419730

Submitted on 18 Mar 2014 by Wesley Allen
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.3013 0.5879 0.7287 0.7783 0.4548

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

ans = Columns 1 through 9 0.2377 0.8771 0.1165 0.4792 0.5154 0.5207 0.3555 0.8188 0.0630 Columns 10 through 18 0.1040 0.2361 0.0837 0.9253 0.7123 0.9810 0.8274 0.6768 0.7107 Columns 19 through 27 0.7586 0.0896 0.0823 0.0443 0.5959 0.1976 0.5549 0.7009 0.0769 Columns 28 through 36 0.0268 0.4047 0.0377 0.6698 0.6171 0.1875 0.0203 0.9662 0.7831 Columns 37 through 45 0.1508 0.7013 0.1716 0.0238 0.4783 0.2770 0.7351 0.4947 0.1300 Columns 46 through 50 0.9107 0.7865 0.2476 0.3885 0.5297

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