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.
% Y = RECONS(X) reconstructs a time series Y from the
% recurrence plot in the matrix X.
......@@ -25,6 +25,9 @@ function xout=recons(varargin)
% $Revision$
%
% $Log$
% Revision 5.1 2008/01/25 12:47:25 marwan
% initial import
%
%
%
%
......@@ -36,7 +39,7 @@ function xout=recons(varargin)
% of the License, or any later version.
errcode = 0;
errcode = 0; %xout = [];
error(nargchk(1,2,nargin));
if nargout>1, error('Too many output arguments'), end
......@@ -137,6 +140,15 @@ while min(NN(:)) < maxN
kold = k;
k=kneu;
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
errcode = 6;
......@@ -163,7 +175,7 @@ delete(h_waitbar)
errcode = 8;
if nargout
xout = xneu;
varargout{1} = xneu;
else
xneu
end
......@@ -220,7 +232,7 @@ catch
disp(' Thank you for your assistance.')
warning('on')
end
try, set(0,props.root), end
try, set(0,props.root), delete(h_waitbar), end
set(0,'ShowHidden','Off')
return
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