This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [1,0,0,1,1,1,1,0,1,1,1,0,0,0,1];
y = [ 2 4 9 12
3 7 11 14
0 1 1 0];
assert(isequal(successive_value(x),y))
|
2 | Pass |
x = [1,0,0,1,1,1,1,0,2,2,2,0,0,0,2345,2345,2345,2345,2345];
y = [2 4 9 12 15
3 7 11 14 19
0 1 2 0 2345 ];
assert(isequal(successive_value(x),y))
|
3 | Pass |
x = ones(1,10);
y = [1;10;1];
assert(isequal(successive_value(x),y))
|
4 | Pass |
x = 1:20;
assert(isempty(successive_value(x)))
|
5 | Pass |
x = repmat([1,0],[1,1000]);
x = [x,fliplr(x)];
y = [2000;2001;0];
assert(isequal(successive_value(x),y))
|
Make the vector [1 2 3 4 5 6 7 8 9 10]
35569 Solvers
Remove the two elements next to NaN value
411 Solvers
Elements with highest local average
70 Solvers
616 Solvers
255 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!