event handling in matlab_ode