Problem 54730. Local Extrema
Solution Stats
Problem Comments
-
6 Comments
Dyuman, Test 5 is missing a parenthesis.
Fixed. It's always something with my test suite :')
Dyuman, Thanks for the problem. It might be good to add that what you mean by a local maximum is not only that the value is the largest value, but also that it is strictly greater than the second largest. Likewise for a local minimum.
William, thanks for the comment.
I thought the value of extrema was based on strict criteria. I stand corrected. The problem statement has been updated.
Yes, if this were a continuous function, an extremum would imply that the value was strictly the largest. In the case of a set of discrete values, though, it may be debatable whether two equally large neighbors should be considered as 2 maxima or not.
I see, thanks for the clarification!
Solution Comments
Show commentsProblem Recent Solvers6
Suggested Problems
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2309 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1193 Solvers
-
9345 Solvers
-
1299 Solvers
-
Create an array (n,n) where only diagonal elements are '1' and others are '0'
83 Solvers
More from this Author31
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!