Cody

# Problem 6. Select every other element of a vector

Solution 2050539

Submitted on 8 Dec 2019 by Alexander Jury
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.3208 0.2116 0.2112 0.0084 0.1299

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.4343 0.6157 0.3102 0.3737 0.3920 0.7808 0.4379 0.6497 0.1243 0.2651 0.5323 0.6374 0.0470 0.4746 0.1739 0.6001 0.1561 Columns 18 through 34 0.7176 0.4179 0.7457 0.8253 0.3117 0.8944 0.4159 0.6797 0.0556 0.8363 0.8543 0.1346 0.8031 0.9933 0.8145 0.7512 0.7382 Columns 35 through 50 0.9409 0.3733 0.5731 0.7129 0.0284 0.5600 0.1220 0.2655 0.8114 0.0814 0.0185 0.8554 0.3324 0.1068 0.1721 0.1253

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'