Cody

# Problem 43684. 0, 2, 0, -2, 0, 2, 0, -2, ...

Solution 1570138

Submitted on 27 Jun 2018
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
n = 1; y_correct = [0]; assert(isequal(seq(n),y_correct))

Error in solution Line: 3 Column: 9 ()-indexing must appear last in an index expression.

2   Fail
n = 4 y_correct = [0, 2, 0, -2]; assert(isequal(seq(n),y_correct))

Error in solution Line: 3 Column: 9 ()-indexing must appear last in an index expression.

3   Fail
n = 5 y_correct = [0, 2, 0, -2, 0]; assert(isequal(seq(n),y_correct))

Error in solution Line: 3 Column: 9 ()-indexing must appear last in an index expression.

4   Fail
n = 8 y_correct = [0, 2, 0, -2, 0, 2, 0, -2]; assert(isequal(seq(n),y_correct))

Error in solution Line: 3 Column: 9 ()-indexing must appear last in an index expression.

5   Fail
n = 25 y_correct = [0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0]; assert(isequal(seq(n),y_correct))

Error in solution Line: 3 Column: 9 ()-indexing must appear last in an index expression.