optimplotx

Optimization plot function: current point at each iteration.

Category: Other public functions: optimfun

Syntax

optimset('PlotFcns', @optimplotx)

Selects the plot for use with solvers such as fminsearch.

Description

Passed in the PlotFcns option, it draws a bar for each component of the current point, so the position of the search can be followed as it moves. It is meant to be called by the solver, not directly.

Example

Follow the point

opts = optimset('PlotFcns', @optimplotx);
x = fminsearch(@(x) (x(1) - 1)^2 + x(2)^2, [0 0], opts);

In the app, the bars are drawn below the code.

See also

optimplotfval optimplotfunccount optimset fminsearch