Cody

Solution 2414295

Submitted on 29 May 2020
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   Fail
x = rand(1,10); actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

n = 10 y = 0.6194 y = 0.3655 y = 0.4941 y = 0.9866 y = 0.0495 y = 0.3531 y = 0.7272 y = 0.7103 y = 0.7747 y = 0.8532

Assertion failed.

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

n = 100 y = 0.3436 y = 0.2814 y = 0.3973 y = 0.6619 y = 0.9290 y = 0.4851 y = 0.3069 y = 0.2667 y = 0.9029 y = 0.3972 y = 0.4748 y = 0.2203 y = 0.0662 y = 0.2284 y = 0.3975 y = 0.4915 y = 0.5778 y = 0.3592 y = 0.5207 y = 0.5894 y = 0.9902 y = 0.7468 y = 0.8468 y = 0.0718 y = 0.6748 y = 0.0316 y = 0.8802 y = 0.2131 y = 0.1845 y = 0.7706 y = 0.0015 y = 0.3477 y = 0.5587 y = 0.6408 y = 0.3045 y = 0.0122 y = 0.8814 y = 0.7682 y = 0.5785 y = 0.1848 y = 0.0143 y = 0.5071 y = 0.6452 y = 0.2213 y = 0.9583 y = 0.5714 y = 0.8527 y = 0.6138 y = 0.3668 y = 0.4014 y = 0.3761 y = 0.0636 y = 0.4647 y = 0.8589 y = 0.3543 y = 0.4825 y = 0.5987 y = 0.0789 y = 0.0116 y = 0.4582 y = 0.7787 y = 0.8645 y = 0.5355 y = 0.2641 y = 0.0499 y = 0.7105 y = 0.0073 y = 0.3940 y = 0.2765 y = 0.7842 y = 0.7454 y = 0.4089 y = 0.0186 y = 0.2758 y = 0.0012 y = 0.5459 y = 0.5285 y = 0.2707 y = 0.3623 y = 0.2470 y = 0.1691 y = 0.4221 y = 0.1221 y = 0.4288 y = 0.8941 y = 0.4375 y = 0.6774 y = 0.7413 y = 0.0184 y = 0.0356 y = 0.9485 y = 0.3866 y = 0.9499 y = 0.4923 y = 0.6508 y = 0.8426 y = 0.5373 y = 0.0320 y = 0.5343 y = 0.7970

Assertion failed.

3   Fail
x = ['A' 'long' 'time' 'ago' 'in' 'a' 'galaxy' 'far' 'far' 'away']; actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

n = 31 y = 'A' y = 'o' y = 'g' y = 'i' y = 'm' y = 'e' y = 'a' y = 'g' y = 'o' y = 'i' y = 'a' y = 'g' y = 'a' y = 'a' y = 'y' y = 'a' y = 'a' y = 'a' y = 'w' y = 'a' y = 'y'

Assertion failed.