odeget
Reads a named option from an ODE options structure.
Category: Mathematics > Numerical Integration and Differential Equations
Syntax
val = odeget(options, 'name')
Returns the value of the option, or [] if it is not set.
val = odeget(options, 'name', default)
Returns default when the option is empty.
Description
The solvers call odeget to read each setting, substituting their own defaults for empty fields. It is useful in functions that receive an options structure from the caller and must fall back on a sensible value.
Input arguments
options- Structure created by
odeset. 'name'- Option name, such as
'RelTol'. default- Value to return if the option is empty.
Output arguments
val- The option value.
Example
Reading with a default
opts = odeset('RelTol', 1e-8);
odeget(opts, 'RelTol')
odeget(opts, 'AbsTol', 1e-10)
Output
ans = 1.0000e-08
ans = 1.0000e-10