DSP Engineer at NASA/GSFC
Watch this Author's files
Also, to remove the annoyance of inexact case matches when you use the any of the HOSA functions, I'd recommend putting this line of code at the top of your script:
For some strange reason, all of the HOSA function file names are written in all caps.
Excellent work. Saved me a much time and headache with some data analysis over here at NASA. Thank you!
Simple and intuitive. This was definitely missing in matlab!
Following improvements could be made:
1. Handle start and end of range in case where it is not exactly on a sample point
2. Check that x is monotonically increasing and resort vectors if necessary.
There is a BUG in the calculation of the index of the upper bound. You must call the min() function to find the correct index, not the max() function.