In matlab, the right way to do this is to use the interp1 command to interpolate. The format of this command is
yout = interp1 (xdata, ydata, xin, ...)
or
yout = interp1 (ydata, xin, ...)
where xdata is then assumed to be 1:length(ydata)
If you want to produce the result you would get from calling
V0FoundDec = Time(round(V0found))
you would say
V0FoundDec = interp1(Time, V0found, 'nearest')
but you can just as easily get linear interpolation (this is the default) with
V0FoundDec = interp1(Time, V0found)
or
V0FoundDec = interp1(Time,V0found,'linear')
and you can also extrapolate outside the limits (using 'extrap' or providing an extrap value), where
Time(round(V0found))
will crash if round(V0found) < 1 or > length(Time)