Cody

Solution 312200

Submitted on 29 Aug 2013 by shantanu
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.4377 0.7014 0.3894 0.1667 0.2449

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.3172 0.2927 0.1845 0.3811 0.0257 0.8524 0.1132 0.1528 0.4984 0.4430 Columns 11 through 20 0.7982 0.5779 0.4556 0.1480 0.0207 0.5308 0.0422 0.6537 0.7207 0.2149 Columns 21 through 30 0.8201 0.7045 0.6391 0.1275 0.5744 0.9179 0.5526 0.1760 0.1235 0.3398 Columns 31 through 40 0.3562 0.3602 0.7528 0.9079 0.3994 0.2442 0.7073 0.9801 0.6198 0.5329 Columns 41 through 50 0.8104 0.4290 0.2214 0.6287 0.3470 0.2160 0.4755 0.7449 0.5572 0.9352

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

Suggested Problems

More from this Author95