The function workflow returns arrays or a solution structure. The object workflow stores the problem in an ode instance and returns a result object from solve.
| Workflow | Main calls | When to use |
|---|---|---|
| Function | ode45, ode15s, ode15i | Compact scripts that return arrays or a solution structure. |
| Object | ode, solve, deval | Reusable problem definitions with solver options and result objects. |
| Post-processing | deval, odextend | Interpolate or continue a computed solution. |
Use a solution structure with deval for interpolation and odextend to continue an integration. Use Events to locate zero crossings, Mass for mass matrix systems, and Jacobian to help stiff solvers.
sol = ode45(@(t,y) -y, [0 1], 1);
yhalf = deval(sol, 0.5)
problem = ode('ODEFcn', @(t,y) -y, 'InitialValue', 1);
result = solve(problem, 0, 1);
value = deval(result, 0.5)
options = odeset('Refine', 4, 'Stats', 'on');
[t, y] = ode45(@(t,y) y, [0 1], 1, options)
| Version | Description |
|---|---|
| 2.0.0 | initial version |