From 915e086a5576c28e6a10254f49a39b29b4ebb7bc Mon Sep 17 00:00:00 2001 From: marwan <> Date: Wed, 2 Jul 2008 11:59:43 +0000 Subject: [PATCH] bug fix for logical data vectors --- crp_big.m | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/crp_big.m b/crp_big.m index 3cc7367..19f5188 100644 --- a/crp_big.m +++ b/crp_big.m @@ -68,7 +68,7 @@ function xout=crp_big(varargin) % b(end+1:end+100) = 100:-1:1; % crp_big(b,1,1,.1,'max') % -% See also CRP, CRP2, JRP and CRQA. +% See also CRP, CRP2, JRP, TAUCRP and CRQA. % Copyright (c) 1998-2007 by AMRON % Norbert Marwan, Potsdam University, Germany @@ -78,6 +78,9 @@ function xout=crp_big(varargin) % $Revision$ % % $Log$ +% Revision 5.11 2007/07/18 17:18:44 marwan +% integer values in the arguments supported +% % Revision 5.10 2007/05/15 17:33:13 marwan % new neighbourhood criterion: fixed RR % @@ -162,24 +165,25 @@ check_meth={'ma','eu','mi','nr','rr','fa','in','om','op','di'}; % maxnorm, eucl check_norm={'non','nor'}; % nonormalize, normalize check_gui={'gui','nog','sil'}; % gui, nogui, silent -if isnumeric(varargin{1})==1 % read commandline input - varargin{9}=[]; - % transform any int to double - intclasses = {'uint8';'uint16';'uint32';'uint64';'int8';'int16';'int32';'int64'}; - flagClass = []; - for i = 1:length(intclasses) - i_int=find(cellfun('isclass',varargin,intclasses{i})); - if ~isempty(i_int) - for j = 1:length(i_int) - varargin{i_int(j)} = double(varargin{i_int(j)}); - end - flagClass = [flagClass; i_int(:)]; +% transform any int to double +intclasses = {'uint8';'uint16';'uint32';'uint64';'int8';'int16';'int32';'int64';'logical'}; +flagClass = []; +for i = 1:length(intclasses) + i_int=find(cellfun('isclass',varargin,intclasses{i})); + if ~isempty(i_int) + for j = 1:length(i_int) + varargin{i_int(j)} = double(varargin{i_int(j)}); end + flagClass = [flagClass; i_int(:)]; end - if ~isempty(flagClass) - disp(['Warning: Input arguments at position [',num2str(flagClass'),'] contain integer values']); - disp(['(now converted to double).']) - end +end +if ~isempty(flagClass) + disp(['Warning: Input arguments at position [',num2str(flagClass'),'] contain integer values']); + disp(['(now converted to double).']) +end + +if isnumeric(varargin{1})==1 % read commandline input + varargin{9}=[]; i_double=find(cellfun('isclass',varargin,'double')); i_char=find(cellfun('isclass',varargin,'char')); -- GitLab