Cody

Solution 164396

Submitted on 19 Nov 2012 by Antonio
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.0364 0.7015 0.9181 0.5343 0.3173

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.0573 0.9835 0.0369 0.5763 0.4357 0.6983 0.6279 0.6726 0.2073 0.3938 Columns 11 through 20 0.4489 0.9042 0.0573 0.7033 0.6819 0.3213 0.8506 0.5470 0.7466 0.6280 Columns 21 through 30 0.9255 0.1753 0.4498 0.2191 0.8822 0.5271 0.7493 0.2078 0.5145 0.2653 Columns 31 through 40 0.3416 0.8239 0.5443 0.7080 0.6071 0.8580 0.0962 0.2758 0.2301 0.1443 Columns 41 through 50 0.1262 0.1200 0.2164 0.0251 0.8946 0.4434 0.4974 0.5735 0.2935 0.9364

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