functionName = {@ode45 @ode23 @ode113 @ode15s};
and we can call in a cycle the desired function:
for iFunction = 1 : size(functionName,2)
f = functionName{iFunction};
tol = 1e-4;
options = odeset ('RelTol',tol,'AbsTol',tol);
[t,y] = f('function_rhs', xspan, ic, options); % SOLVE ODEs
figure
plot(t,y)
title(func2str(f))
end
Where function_rhs is the right side of the ODE we want to solve.
In this way we'll obtain 4 figures with the ODE solver name in the title.