Cody

Solution 1573851

Submitted on 3 Jul 2018 by vijaylaxmi lendale
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.0989 0.4389 0.2938 0.1057 0.7796

2   Pass
x = rand(1,100); actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

y = Columns 1 through 17 0.2269 0.5141 0.2340 0.2818 0.5803 0.6468 0.4410 0.9075 0.5662 0.6441 0.9121 0.0620 0.5767 0.0910 0.8428 0.4865 0.5783 Columns 18 through 34 0.3531 0.3471 0.1806 0.0829 0.2584 0.2985 0.1301 0.9874 0.1671 0.9791 0.6653 0.6461 0.1128 0.4554 0.5266 0.1114 0.2835 Columns 35 through 50 0.8103 0.1086 0.2632 0.9391 0.5254 0.1557 0.5142 0.7252 0.0111 0.4526 0.8788 0.1530 0.3174 0.0419 0.2480 0.4586

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 = 65 111 103 105 101 103 105 97 97 97 121 97 102 114 119 121

Suggested Problems

More from this Author95