Cody

Solution 1103008

Submitted on 12 Jan 2017 by dsathyaraj dorairaj
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.4617 0.0746 0.9883 0.4068 0.1015

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.2548 0.3076 0.3858 0.8797 0.2020 0.6654 0.4651 0.7217 0.9773 Columns 10 through 18 0.5532 0.3202 0.4261 0.2274 0.3302 0.5816 0.1370 0.1726 0.5182 Columns 19 through 27 0.7574 0.3844 0.2757 0.6790 0.4923 0.2165 0.8429 0.7034 0.4418 Columns 28 through 36 0.2004 0.9533 0.2960 0.5082 0.3637 0.8894 0.3650 0.5169 0.8310 Columns 37 through 45 0.6475 0.6305 0.8827 0.2137 0.1574 0.0881 0.8319 0.6501 0.1813 Columns 46 through 50 0.6028 0.8548 0.9596 0.6487 0.1366

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