[T,Z] = ode45(@bouncing, [0 12], [100 0],'tspan','options','events');options = odeset('events');events(t,z) = [y(1)-10,1,-1]value = y(1)-10;isterminal = 1;direction = -1;axis([-5 5 0 120])a = 0;y = Z(:,1);while a < 69 viscircles([0,y(1+a)],10,'Linewidth',10'); pause(0.1); cla; a = a+1;end
MATLAB: Ode45 events using problem
eventsode45
Related Question
- Solving a coupled system of differential equations with matrix form!!
- Problem with plotting a function on a specified domain
- MATLAB event function help
- Using dde23 with events option
- Do I get the error “Undefined function or variable ‘t’.” when using an event with ode45
- How to stop dde23 when one of states reach certain value
Best Answer