Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
n = 12;
x = [2 3];
v_correct = [1 2 4 5 8 10 12 14 15 16 19 20];
assert(isequal(segnum(n,x),v_correct))
|
2 | Pass |
n = 22;
x = 0;
v_correct = [1 2 4 5 8 10 14 15 16 21 22 25 26 28 33 34 35 36 38 40 42 46];
assert(isequal(segnum(n,x),v_correct))
|
3 | Pass |
n = 15;
x = [2 4];
v_correct = [1 2 4 5 7 8 10 11 13 14 16 17 19 20 22];
assert(isequal(segnum(n,x),v_correct))
|
4 | Pass |
n = 23;
x = [2 3 5 6];
v_correct = [1 2 4 5 8 10 12 14 15 16 19 21 24 25 27 28 32 33 34 37 38 42 43];
assert(isequal(segnum(n,x),v_correct))
|
234 Solvers
Compute a dot product of two vectors x and y
750 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
546 Solvers
93 Solvers
76 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!