Cody

Solution 484367

Submitted on 8 Aug 2014 by Klim Kolyvanov
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.8586 0.5454 0.9985 0.5839 0.3065

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.6864 0.3186 0.3265 0.9669 0.4246 0.7859 0.4253 0.5759 0.0110 Columns 10 through 18 0.1449 0.2607 0.4875 0.2787 0.0661 0.7309 0.3099 0.4560 0.8659 Columns 19 through 27 0.7173 0.5294 0.0520 0.6841 0.7173 0.6888 0.2301 0.7588 0.4831 Columns 28 through 36 0.6137 0.4251 0.0364 0.4134 0.5840 0.1289 0.2535 0.8130 0.0757 Columns 37 through 45 0.5679 0.9776 0.0875 0.2164 0.8368 0.5301 0.1593 0.4262 0.2819 Columns 46 through 50 0.1011 0.3867 0.1962 0.8593 0.4157

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