Average the values in a vector between two cutoff points specified by a separate vector.
Useful links