function [value,isterminal,direction] = eventep(t,x) value = x(2); isterminal = 1; direction = 0;