ode45 - Makers of MATLAB and Simulink - MATLAB & Simulink
https://www.mathworks.com/help/matlab/ref/ode45.html[t,y,te,ye,ie] = ode45(odefun,tspan,y0,options) additionally finds where functions of (t,y), called event functions, are zero. In the output, te is the time of the event, ye is the solution at the time of the event, and ie is the index of the triggered event. For each event function, specify whether the integration is to terminate at a zero and whether the direction of the zero crossing matters.
ode23 - Makers of MATLAB and Simulink - MATLAB & Simulink
https://www.mathworks.com/help/matlab/ref/ode23.html[t,y,te,ye,ie] = ode23(odefun,tspan,y0,options) additionally finds where functions of (t,y), called event functions, are zero. In the output, te is the time of the event, ye is the solution at the time of the event, and ie is the index of the triggered event. For each event function, specify whether the integration is to terminate at a zero and whether the direction of the zero crossing matters.
ode45 - Makers of MATLAB and Simulink - MATLAB & Simulink
www.mathworks.com › help › matlab[t,y,te,ye,ie] = ode45(odefun,tspan,y0,options) additionally finds where functions of (t,y), called event functions, are zero. In the output, te is the time of the event, ye is the solution at the time of the event, and ie is the index of the triggered event.
ode45 where odefun requires more parameters
www.mathworks.com › matlabcentral › answersDec 25, 2014 · If I understand correctly, what you want to do is a common way of passing extra parameters to your ODE function. To use it with ode45, you only pass the ODE solver the ‘t’ and ‘y’ variables: [t,y] = ode45 (@ (t,y) odefun (t,y,a,b,c), tspan, ic); Note that ‘a’, ‘b’, and ‘c’ have to exist in your workspace.