Cody

Solution 180679

Submitted on 21 Dec 2012 by Jack
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.2254 0.3282 0.1428 0.1731 0.5438

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.7892 0.9525 0.4816 0.8048 0.3573 0.2613 0.9037 0.5571 0.8006 0.0272 Columns 11 through 20 0.1454 0.0277 0.4519 0.0212 0.0206 0.7273 0.6687 0.5528 0.8982 0.1007 Columns 21 through 30 0.0454 0.7453 0.1016 0.0078 0.1000 0.3384 0.3668 0.6377 0.1607 0.7101 Columns 31 through 40 0.5236 0.0190 0.8659 0.4030 0.1679 0.9933 0.4488 0.5985 0.8249 0.6274 Columns 41 through 50 0.1202 0.6833 0.1379 0.0133 0.8449 0.5643 0.4328 0.7722 0.5578 0.1196

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