Cody

Solution 1101804

Submitted on 11 Jan 2017 by Mohan Shanmugam
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.9225 0.7445 0.7514 0.2038 0.8640

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.4708 0.1091 0.1214 0.8446 0.6308 0.4135 0.2104 0.8773 0.3846 Columns 10 through 18 0.7717 0.7150 0.7640 0.9718 0.3918 0.3344 0.0127 0.2034 0.3816 Columns 19 through 27 0.5701 0.1548 0.4259 0.8687 0.4191 0.8299 0.9959 0.5343 0.7040 Columns 28 through 36 0.0508 0.3064 0.1200 0.8992 0.4171 0.3601 0.7390 0.2040 0.9195 Columns 37 through 45 0.7211 0.3352 0.7635 0.5675 0.3658 0.3938 0.8797 0.0865 0.4781 Columns 46 through 50 0.3492 0.6619 0.8046 0.1816 0.6224

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