Will work also for non-square input matrix x.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 1; n=1;
y_correct = 1;
assert(isequal(stop_zig(x,n),y_correct))
|
2 | Pass |
x =[1 2 3; 4 5 6; 7 8 9]; n=3;
y_correct = [ 1 2 4 7 5 3];
assert(isequal(stop_zig(x,n),y_correct))
|
3 | Pass |
x =[1 2 3; 4 5 6; 7 8 9]; n=-3;
y_correct = [ 9 8 6 3 5 7];
assert(isequal(stop_zig(x,n),y_correct))
|
4 | Pass |
x =[1 2 3; 4 5 6; 7 8 9]; n=2;
y_correct = [ 1 2 4];
assert(isequal(stop_zig(x,n),y_correct))
|
5 | Pass |
x =[1 2 3 4;
4 5 6 7;
7 8 9 10;
10 11 12 13]; n=-3;
y_correct = [ 13 12 10 7 9 11];
assert(isequal(stop_zig(x,n),y_correct))
|
3074 Solvers
102 Solvers
What is the distance from point P(x,y) to the line Ax + By + C = 0?
277 Solvers
Getting the indices from a vector
3206 Solvers
216 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!