Cody

Solution 2182280

Submitted on 30 Mar 2020 by Rafael Rojas
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.3919 0.6369 0.6404 0.7505 0.6371

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

y = Columns 1 through 18 0.2180 0.4086 0.7985 0.5170 0.3071 0.0660 0.9886 0.3455 0.1589 0.4665 0.9450 0.9633 0.0017 0.5266 0.1176 0.1540 0.5517 0.5187 Columns 19 through 36 0.7394 0.4587 0.4478 0.6820 0.5969 0.9900 0.0596 0.8136 0.0416 0.0940 0.6293 0.6544 0.5236 0.7050 0.6198 0.9852 0.2830 0.5324 Columns 37 through 50 0.7175 0.6819 0.9745 0.1651 0.7743 0.1935 0.2741 0.9188 0.1907 0.7795 0.5237 0.7780 0.3603 0.1084

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 = 'Aogiegiaaayafrwy'

Suggested Problems

More from this Author95