How to stop integration by ODE after the first time step?

4 views (last 30 days)
Hi,
Does anyone know how to stop the integration by ode45 after the very first time step?
I tried using the odeset and events functions, egs:
function [value,isterminal,direction] = events1(t,T))
but when I got to the step where I needed to define 'value' in the events function, I got stuck. I wanted to use this to stop the integration (by setting isTerminal to 1) on the condition that T is positive, but the parameter 'value' does not seem to allow me to set it that way.
Please advise.
Thanks
  1 Comment
Jan
Jan on 7 Mar 2015
Pleae explain, why you think that it "does not seem to allow me to set it that way".

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!