Plot Function Syntax

The PlotFcn option specifies one or more functions that an optimization function calls at each iteration to plot various measures of progress while the algorithm executes. The structure of a plot function is the same as that for an output function. For more information on writing and calling a plot function, see Output Function Syntax. For an example of using built-in plot functions, Using a Plot Function.

To view a predefined plot function listed for PlotFcn, open the function in the MATLAB® Editor. For example, to view the file corresponding to the norm of residuals, enter:

edit optimplotresnorm.m
You can use any predefined plot function as a template for writing a custom plot function.

Related Topics