odeplot
ODE output function: plots the solution components against time as the solver runs.
Category: Other public functions: funfun
Syntax
status = odeplot(t, y, flag)
Output-function form: called by the solver at the start, at each accepted step and at the end.
Description
This is the default output function when an ODE solver is called without output arguments. It can also be requested explicitly with odeset('OutputFcn', @odeplot). Each accepted step adds a segment to the lines of all components, so the plot grows as the integration advances and shows progress on a long run.
Input arguments
t, y- Time points and state columns passed in by the solver.
flag'init',''or'done'.
Output arguments
status- Logical,
trueto stop the solver. Alwaysfalsehere.
Example
Watch a decay
opts = odeset('OutputFcn', @odeplot);
[t, y] = ode45(@(t, y) -y, [0 5], 1, opts);
In the app, the curve is drawn below the code.