Cody

Solution 1862605

Submitted on 1 Jul 2019 by Medha Poori
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))

len = 5 y = 0.8992 0.5150 0 0 0 y = 0.8992 0.5150 0.9105 0 0 y = 0.8992 0.5150 0.9105 0.5917 0 y = 0.8992 0.5150 0.9105 0.5917 0.2115

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

len = 50 y = Columns 1 through 18 0.5784 0.7551 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0 0 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0.8541 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0.8541 0.7429 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0.8541 0.7429 0.9384 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0.8541 0.7429 0.9384 0.3686 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0.8541 0.7429 0.9384 0.3686 0.6210 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0.8541 0.7429 0.9384 0.3686 0.6210 0.5241 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 through 18 0.5784 0.7551 0.3044 0.6321 0.3372 0.0257 0.7884 0.5868 0.5412 0.1638 0.7419 0.8541 0.7429 0.9384 0.3686 0.6210 0.5241 0.0718 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = Columns 1 throu...

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

len = 16 y = 65 111 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = 65 111 103 0 0 0 0 0 0 0 0 0 0 0 0 0 y = 65 111 103 105 0 0 0 0 0 0 0 0 0 0 0 0 y = 65 111 103 105 101 0 0 0 0 0 0 0 0 0 0 0 y = 65 111 103 105 101 103 0 0 0 0 0 0 0 0 0 0 y = 65 111 103 105 101 103 105 0 0 0 0 0 0 0 0 0 y = 65 111 103 105 101 103 105 97 0 0 0 0 0 0 0 0 y = 65 111 103 105 101 103 105 97 97 0 0 0 0 0 0 0 y = 65 111 103 105 101 103 105 97 97 97 0 0 0 0 0 0 y = 65 111 103 105 101 103 105 97 97 97 121 0 0 0 0 0 y = 65 111 103 105 101 103 105 97 97 97 121 97 0 0 0 0 y = 65 111 103 105 101 103 105 97 97 97 121 97 102 0 0 0 y = 65 111 103 105 101 103 105 97 97 97 121 97 102 114 0 0 y = 65 111 103 105 101 103 105 97 97 97 121 97 102 114 119 0 y = 65 111 103 105 101 103 105 97 97 97 121 97 102 114 119 121