Cody

Solution 196554

Submitted on 25 Jan 2013 by Lis Ace
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.9444 0.8230 0.6606 0.7728 0.8266

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.2944 0.2027 0.0877 0.8096 0.4949 0.8005 0.6175 0.2210 0.4982 0.8023 Columns 11 through 20 0.2309 0.2643 0.7271 0.5610 0.9733 0.5312 0.0726 0.9732 0.6761 0.0634 Columns 21 through 30 0.0917 0.0414 0.3460 0.4353 0.3176 0.1049 0.4007 0.5165 0.8321 0.1266 Columns 31 through 40 0.9156 0.4472 0.0084 0.0671 0.0744 0.0629 0.0298 0.6600 0.0900 0.4094 Columns 41 through 50 0.3918 0.1798 0.9498 0.7808 0.1860 0.8029 0.9595 0.4223 0.8588 0.8444

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