>> a=[2 1 720 2.3 2.6 -40 -2 7 3];
1.6500 2.7000 2.8000 2.9000
2.0000 1.0000 1.6500 2.3000 2.6000 2.7000 2.8000 2.9000 3.0000
iswithin is my utility helper function--
flg= (x>=lo) & (x<=hi);
that is simply "syntactic sugar" to put the ugly condition test out of sight.
You can obviously shorten the final by getting rid of some temporaries; just demonstrating the idea.
Unfortunate that you can't tell interp1 to ignore the values at the Xq locations even if present and have to make the selection w/o them to not just return the values in the a vector for them...that would save a step.