hi, i have a vector X and a vector Y (both in ascending order). for every element in X i want the indexes of the values in Y between which this element lies. Actually, 1 index suffices (preferably the higher bound).
For example if have
Y=[0, 1, 2, 3, 4, 5]
X=[0.1, 2.5, 2.8, 4.1];
then I want to get as a result:
I can do this with a for loop:
My question is whether it is possible to vectorize this, and how... Many thanks in advance!