help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Code optimization


From: iwaddington .
Subject: Code optimization
Date: Sat, 11 Oct 2014 23:47:28 -0300

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]