Mathematics |

**Minimizing Functions of One Variable**

Given a mathematical function of a single variable coded in an M-file, you can use the `fminbnd`

function to find a local minimizer of the function in a given interval. For example, to find a minimum of the `humps`

function in the range (0.3, 1), use

You can ask for a tabular display of output by passing a fourth argument created by the `optimset`

command to `fminbnd`

Func-count x f(x) Procedure 1 0.567376 12.9098 initial 2 0.732624 13.7746 golden 3 0.465248 25.1714 golden 4 0.644416 11.2693 parabolic 5 0.6413 11.2583 parabolic 6 0.637618 11.2529 parabolic 7 0.636985 11.2528 parabolic 8 0.637019 11.2528 parabolic 9 0.637052 11.2528 parabolic x = 0.6370

This shows the current value of `x`

and the function value at `f(x)`

each time a function evaluation occurs. For `fminbnd`

, one function evaluation corresponds to one iteration of the algorithm. The last column shows what procedure is being used at each iteration, either a golden section search or a parabolic interpolation.

Minimizing Functions and Finding Zeros | Minimizing Functions of Several Variables |