Cody

Solution 2108975

Submitted on 28 Jan 2020 by Nicholas Stovall-Kurtz
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))

vectorLength = 10 y = 0.6039 y = 0.6039 0 0.0548 y = 0.6039 0 0.0548 0 0.2251 y = 0.6039 0 0.0548 0 0.2251 0 0.7720 y = 0.6039 0 0.0548 0 0.2251 0 0.7720 0 0.1962

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

vectorLength = 100 y = 0.9614 y = 0.9614 0 0.3792 y = 0.9614 0 0.3792 0 0.4258 y = 0.9614 0 0.3792 0 0.4258 0 0.9682 y = 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 y = 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 y = 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 y = 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 y = 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 19 0 0.1938 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 21 0 0.1938 0 0.7323 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 23 0 0.1938 0 0.7323 0 0.5663 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 25 0 0.1938 0 0.7323 0 0.5663 0 0.8694 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 27 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 29 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 31 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 33 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Column 35 0.1584 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 37 0.1584 0 0.9194 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 39 0.1584 0 0.9194 0 0.5129 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 41 0.1584 0 0.9194 0 0.5129 0 0.9797 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 43 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 45 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 0 0.9725 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 47 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 0 0.9725 0 0.6979 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 49 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 0 0.9725 0 0.6979 0 0.0646 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 51 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 0 0.9725 0 0.6979 0 0.0646 0 0.4127 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 51 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 0 0.9725 0 0.6979 0 0.0646 0 0.4127 Columns 52 through 53 0 0.3647 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 51 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 0 0.9725 0 0.6979 0 0.0646 0 0.4127 Columns 52 through 55 0 0.3647 0 0.2773 y = Columns 1 through 17 0.9614 0 0.3792 0 0.4258 0 0.9682 0 0.1043 0 0.6536 0 0.7028 0 0.0691 0 0.7657 Columns 18 through 34 0 0.1938 0 0.7323 0 0.5663 0 0.8694 0 0.8440 0 0.4241 0 0.1786 0 0.4919 0 Columns 35 through 51 0.1584 0 0.9194 0 0.5129 0 0.9797 0 0.2021 0 0.9725 0 0.6979 0 0.0646 0 0.4127 Column...

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

vectorLength = 31 y = 'A' y = 'A o' y = 'A o g' y = 'A o g i' y = 'A o g i e' y = 'A o g i e g' y = 'A o g i e g i' y = 'A o g i e g i a' y = 'A o g i e g i a a' y = 'A o g i e g i a a a' y = 'A o g i e g i a a a y' y = 'A o g i e g i a a a y a' y = 'A o g i e g i a a a y a f' y = 'A o g i e g i a a a y a f r' y = 'A o g i e g i a a a y a f r w' y = 'A o g i e g i a a a y a f r w y'

Suggested Problems

More from this Author95