Hi everyone, does anyone know how to extract the time step index in an ode solver? such as ode45? F

So basically what I'm trying to do is import another variable which is needed for the initiation of the calculations, I need the code to read the correct value at each timestep, if I add the variable to the end (so after the options input variable) it imports the whole matrix (for all timesteps)...

 Akzeptierte Antwort

What is the problem, when the complete matrix is delivered?
Use anonymous functions to provide parameters: http://www.mathworks.com/matlabcentral/answers/1971
Remember, that Matlab's ODE integrators are not designed to handle discontinuties: http://www.mathworks.com/matlabcentral/answers/59582#answer_72047

1 Kommentar

Thanks, Jan, The problem is the equation uses another variable that changes at each time step within the ode solver. It might be a stupid question but I cant get it to work.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by