Cody

Solution 295366

Submitted on 2 Aug 2013 by kevin
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.7447 0.6868 0.3685 0.7802 0.9294

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

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

Suggested Problems

More from this Author95