Matlab's fminbnd function finds a minimizer of a function within an interval. If often gets stuck in local minima.
Can you do better than fminbnd, for a single variable?
You are given a function handler fun (one scalar input, one scalar output) and a the search bounds xmin and xmax. Return a minimizer xopt between xmin and xmax such that fun(xopt) < fminbnd(fun,xmin,xmax)
Check Problem 45951 for the unbounded version (harder)!
https://www.mathworks.com/matlabcentral/cody/problems/45951-function-minimization-beat-fminsearch
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
Return the largest number that is adjacent to a zero
5525 Solvers
-
2376 Solvers
-
Project Euler: Problem 3, Largest prime factor
1808 Solvers
-
63 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
892 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!