Cody

Solution 1854232

Submitted on 20 Jun 2019
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))

Error: File: everyOther.m Line: 5 Column: 9 "i" previously appeared to be used as a function or command, conflicting with its use here as the name of a variable. A possible cause of this error is that you forgot to initialize the variable, or you have initialized it implicitly using load or eval. Error in Test1 (line 2) actual = everyOther(x);

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

Error: File: everyOther.m Line: 5 Column: 9 "i" previously appeared to be used as a function or command, conflicting with its use here as the name of a variable. A possible cause of this error is that you forgot to initialize the variable, or you have initialized it implicitly using load or eval. Error in Test2 (line 2) actual = everyOther(x);

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

Error: File: everyOther.m Line: 5 Column: 9 "i" previously appeared to be used as a function or command, conflicting with its use here as the name of a variable. A possible cause of this error is that you forgot to initialize the variable, or you have initialized it implicitly using load or eval. Error in Test3 (line 2) actual = everyOther(x);

Suggested Problems

More from this Author95