Hi everyone, I would like to vectorize the following loop, which is only partially vectorized, and takes about 3s for n=32000 :
n=length(noise);
h=zeros(n,1);
j=1;
for i=1:n
ind=find((noise(i+1:n)-noise(i))<=r,1,"first");
if !isempty(ind) && ind<=2**escala
h(j++)=ind;
endif
endfor
Any ideas ? Thanks.