Skip to content
Snippets Groups Projects
Commit d2dd2dc5 authored by marwan's avatar marwan
Browse files

computation of recurrence times is now faster

parent a8c1d7b9
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,9 @@ function xout=crqa(varargin)
% $Revision$
%
% $Log$
% Revision 5.14 2005/04/06 12:59:24 marwan
% several small bug fixes which improves the precision
%
% Revision 5.13 2005/04/01 12:19:51 marwan
% bug in minimal length for diagonal and vertical lines fixed
%
......@@ -944,15 +947,24 @@ else
X_theiler=X;
end
% compute recurrence times of 1st and 2nd type
errcode=20;
t1=[0];t2=[];
for i2=1:size(X_theiler,2)
if(Nx-w < 2), waitbar(i2/size(X_theiler,2)), end
rps2=find(diff(double(X_theiler(:,i2)))==1);
rps=find(X_theiler(:,i2));
t1=[t1;diff(rps)];
t2=[t2;diff(rps2)];
% compute recurrence times of 1st and 2nd type
if size(X_theiler,2) > 1000
t1=[];t2=[];
rps2=find(diff(double(X_theiler(:)))==1);
rps=find(X_theiler(:));
t1=diff(rps);
t2=diff(rps2);
else
t1 = []; t2 = [];
for i2=1:size(X_theiler,2)
if(Nx-w < 2), waitbar(i2/size(X_theiler,2)), end
rps2=find(diff(double(X_theiler(:,i2)))==1);
rps=find(X_theiler(:,i2));
t1=[t1;diff(rps)];
t2=[t2;diff(rps2)];
end
end
t1=mean(t1);
t2=mean(t2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment