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

Including of a abort condition in order to avoid infinite loops.

parent d0b07d2b
No related branches found
No related tags found
No related merge requests found
function xout=recons(varargin) function varargout=recons(varargin)
%RECONS Reconstruct a time series from a recurrence plot. %RECONS Reconstruct a time series from a recurrence plot.
% Y = RECONS(X) reconstructs a time series Y from the % Y = RECONS(X) reconstructs a time series Y from the
% recurrence plot in the matrix X. % recurrence plot in the matrix X.
...@@ -25,6 +25,9 @@ function xout=recons(varargin) ...@@ -25,6 +25,9 @@ function xout=recons(varargin)
% $Revision$ % $Revision$
% %
% $Log$ % $Log$
% Revision 5.1 2008/01/25 12:47:25 marwan
% initial import
%
% %
% %
% %
...@@ -36,7 +39,7 @@ function xout=recons(varargin) ...@@ -36,7 +39,7 @@ function xout=recons(varargin)
% of the License, or any later version. % of the License, or any later version.
errcode = 0; errcode = 0; %xout = [];
error(nargchk(1,2,nargin)); error(nargchk(1,2,nargin));
if nargout>1, error('Too many output arguments'), end if nargout>1, error('Too many output arguments'), end
...@@ -137,6 +140,15 @@ while min(NN(:)) < maxN ...@@ -137,6 +140,15 @@ while min(NN(:)) < maxN
kold = k; kold = k;
k=kneu; k=kneu;
r = [r; k]; % add the new found index to the rank order vector r = [r; k]; % add the new found index to the rank order vector
if length(r) > N(1) + 1
delete(h_waitbar)
disp(['Critical abort. Could not find enough corresponding neigbours.',10,'Perhaps the recurrence threshold is too small.'])
if nargout
varargout{1} = NaN;
end
return
end
end end
errcode = 6; errcode = 6;
...@@ -163,7 +175,7 @@ delete(h_waitbar) ...@@ -163,7 +175,7 @@ delete(h_waitbar)
errcode = 8; errcode = 8;
if nargout if nargout
xout = xneu; varargout{1} = xneu;
else else
xneu xneu
end end
...@@ -220,7 +232,7 @@ catch ...@@ -220,7 +232,7 @@ catch
disp(' Thank you for your assistance.') disp(' Thank you for your assistance.')
warning('on') warning('on')
end end
try, set(0,props.root), end try, set(0,props.root), delete(h_waitbar), end
set(0,'ShowHidden','Off') set(0,'ShowHidden','Off')
return return
end end
......
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