Home vectorising multiple calls of Matlab 'find'
 I make a large number of calls to the 'find' function of Matlab. For example, the following should give the essence: x=rand(1,10^8); indx=zeros(1,10^8); for i=1:10^8 indx(i) = find([0.2, 0.52, 0.76,1] < x(i), 1, 'last'); end  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. thanks.