yl is -1, which I don't think is expected, causing all the "last" indices to be lower than the "first" indices. But having investigated thus far I'm not sure whether I did something wrong, maybe to do ...
Download the project code: reduce-linear-interp1 Run INSTALL_RLI1.m to automatically add the project files to your MATLAB path and open some examples. An easy method ...