Cody

Solution 235953

Submitted on 25 Apr 2013 by stefano facchin
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.5270 0.7784 0.2788 0.8647 0.2399

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

ans = Columns 1 through 10 0.4794 0.9347 0.7089 0.8997 0.3359 0.8281 0.3662 0.5348 0.0684 0.0683 Columns 11 through 20 0.1234 0.8989 0.1202 0.8750 0.0419 0.0766 0.4565 0.6992 0.6287 0.6624 Columns 21 through 30 0.4675 0.0681 0.3080 0.6524 0.7151 0.4880 0.9360 0.1171 0.6849 0.9701 Columns 31 through 40 0.7603 0.4030 0.4956 0.7437 0.0896 0.3896 0.1794 0.9052 0.9998 0.0369 Columns 41 through 50 0.9976 0.8735 0.9875 0.5643 0.3378 0.0137 0.9227 0.4739 0.3090 0.9820

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