I did not try running your code, but I'm pretty confident that this line
if time5_00(x+1)> timeV_5_00(y) >time5_00(x)
is not doing what you intend.
I'm guessing you think that that is going to check if timeV_5_00(y) is between the other two times. But it does not do that. The MATLAB if statement syntax does not operate like that. (You might want to take a look at the documentation.)
If I am correct about that, you need to code that line as
if (time5_00(x+1)> timeV_5_00(y)) && (timeV_5_00(y) > time5_00(x))