I make a large number of calls to the 'find' function of Matlab. For example, the following should give the essence:
indx(i) = find([0.2, 0.52, 0.76,1] < x(i), 1, 'last');
Is there a way to vectorize this code to speed it up? Just including x as a vector creates an error. If vectorization is not possible, then any other suggestions for speed would be appreciated. The actual problem I wish to solve has a considerably longer vector in the place of [0.2, 0.52, 0.76,1], so any solution shouldn't depend on the specific vector I provided.