You have to solve the non-linear time variant differential equation:
with initial condition as input of the function
and return the time 'te' when 'y' crosses zero from the negatives values to the positive values.
tip: use the 'Events' option in odeset to detect the crossing, stop integration and get the time 'te'. See how to use it here : http://www.mathworks.com/help/matlab/math/ode-event-location.html?searchHighlight=ballode