If an array is given as input then find the index of consecutive elements that represent maximum change.
Example:
Input x = [1 10 3 0 2 4 0 -8 9 1]
Output y = [8 9]
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers182
Suggested Problems
-
Find out missing number from a vector of 9 elements
322 Solvers
-
Replace multiples of 5 with NaN
470 Solvers
-
Create matrix of replicated elements
399 Solvers
-
767 Solvers
-
Sum the numbers on the main diagonal
617 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Additional test cases have been added.
This problem needs more tests. For instance, x = [1 10 3 0 2 4 0 8 -9 1] is a case with a non-positive difference, but a maximum change, which would make many solutions fail.