Now I have a new value, let's say 8.54 and I want to find the position in the array a. The position would be after element 6 and before element 23.54. I.e. I should somehow retrieve the index position 3 (corresponding to 6) or 4 (corresponding to 23.54).
How can I do that efficiently in Matlab? I tried out the find method but it doesn't work.