Cody

Solution 227527

Submitted on 6 Apr 2013 by kurguz
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.4868 0.4468 0.5085 0.8176 0.6443

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.8116 0.3507 0.8759 0.6225 0.2077 0.4709 0.8443 0.2259 0.2277 0.3111 Columns 11 through 20 0.4302 0.9049 0.4389 0.2581 0.5949 0.6028 0.2217 0.2967 0.4242 0.0855 Columns 21 through 30 0.8010 0.9289 0.4886 0.2373 0.9631 0.5211 0.4889 0.6791 0.3674 0.0377 Columns 31 through 40 0.9133 0.0987 0.3354 0.1366 0.1068 0.4942 0.7150 0.8909 0.6987 0.0305 Columns 41 through 50 0.5000 0.9047 0.6177 0.8055 0.1829 0.8865 0.4899 0.9787 0.5005 0.0596

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