Cody

# Problem 6. Select every other element of a vector

Solution 1912703

Submitted on 26 Aug 2019 by Aravind Chintalapudi
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))

x = 0.5367 0.0843 0.9844 0.9194 0.1469

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

x = Columns 1 through 18 0.1135 0.4286 0.9120 0.1348 0.5381 0.0063 0.0421 0.4927 0.1376 0.4459 0.9505 0.6794 0.7487 0.0912 0.7371 0.4277 0.1110 0.3217 Columns 19 through 36 0.8969 0.8948 0.2412 0.6094 0.8381 0.5069 0.6544 0.0672 0.9699 0.0018 0.0503 0.3184 0.7654 0.4926 0.3159 0.9344 0.2704 0.3416 Columns 37 through 50 0.8046 0.4743 0.0134 0.2387 0.8806 0.2906 0.1750 0.7874 0.5431 0.5661 0.1537 0.3395 0.3553 0.7364

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))

x = 'Aogiegiaaayafrwy'