Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
n = 5;
y_correct = [1 -1 1 -1 1];
assert(isequal(alternating1_1(n),y_correct))
y =
1
y =
1 -1
y =
1 -1 1
y =
1 -1 1 -1
y =
1 -1 1 -1 1
|
2 | Pass |
n = 8;
y_correct = [1 -1 1 -1 1 -1 1 -1];
assert(isequal(alternating1_1(n),y_correct))
y =
1
y =
1 -1
y =
1 -1 1
y =
1 -1 1 -1
y =
1 -1 1 -1 1
y =
1 -1 1 -1 1 -1
y =
1 -1 1 -1 1 -1 1
y =
1 -1 1 -1 1 -1 1 -1
|
271 Solvers
484 Solvers
Flip the vector from right to left
2667 Solvers
88 Solvers
52 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!