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 = ones(1,25);
n=[0,2];
y_correct = x;
assert(isequal(limit2interval(x,n),y_correct))
|
2 | Pass |
x= [1 2 3 4 5 1 2 4 6];
n=[3,5];
y_correct= [3 3 3 4 5 3 3 4 5];
assert(isequal(limit2interval(x,n),y_correct))
|
3 | Pass |
x= magic(7);
n=[7,14];
y_correct=ones(7)*14-sparse([4 5 3 2 3 1 2 1 7 6 7 5 6],[1 1 2 3 3 4 4 5 5 6 6 7 7],[7 1 7 7 6 7 5 4 7 7 3 7 2])
assert(isequal(limit2interval(x,n),y_correct))
y_correct =
14 14 14 7 10 14 14
14 14 7 9 14 14 14
14 7 8 14 14 14 14
7 14 14 14 14 14 14
13 14 14 14 14 14 7
14 14 14 14 14 7 12
14 14 14 14 7 11 14
|
Find the two most distant points
1629 Solvers
Implement simple rotation cypher
943 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
547 Solvers
The sum of the numbers in the vector
426 Solvers
140 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!