Cody

Solution 2162721

Submitted on 17 Mar 2020 by Isabel Haupt
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))

c = 1 3 5 7 9 y = 0.4544 0.6888 0.8704 0.9854 0.4061

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

c = Columns 1 through 29 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 Columns 30 through 50 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 y = Columns 1 through 17 0.8403 0.2765 0.8897 0.6406 0.7014 0.1215 0.7686 0.8772 0.6641 0.1485 0.6561 0.9205 0.1874 0.7794 0.2093 0.9281 0.8720 Columns 18 through 34 0.8692 0.9902 0.9659 0.8263 0.9926 0.8434 0.2705 0.5317 0.5196 0.7750 0.2793 0.3386 0.3717 0.2935 0.2123 0.9839 0.2221 Columns 35 through 50 0.7562 0.2408 0.6700 0.9715 0.2462 0.4720 0.4847 0.0924 0.7240 0.9971 0.1153 0.8911 0.7011 0.6167 0.0352 0.3886

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

c = 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 y = 'Aogiegiaaayafrwy'