diff --git a/crp2.m b/crp2.m index a51fb02da94446d07f2452f038447bccc330bc0b..863033ba92dbca46c2511dae240f11d684952c68 100644 --- a/crp2.m +++ b/crp2.m @@ -67,7 +67,7 @@ function xout=crp2(varargin) % b = sin(.01 * ([1:1000] * 2 * pi/67) .^2); % crp2(b(1:500),a(1:700),3,10,.06,'fan') % -% See also CRP, CRP_BIG, JRP and TRACKPLOT. +% See also CRP, CRP_BIG, JRP, TAUCRP and TRACKPLOT. % % References: % Marwan, N., Thiel, M., Nowaczyk, N.: @@ -82,6 +82,9 @@ function xout=crp2(varargin) % $Revision$ % % $Log$ +% Revision 5.14 2007/07/18 17:18:44 marwan +% integer values in the arguments supported +% % Revision 5.13 2007/05/15 17:33:13 marwan % new neighbourhood criterion: fixed RR % @@ -176,7 +179,7 @@ set(0,'ShowHidden','On') error(nargchk(1,9,nargin)); if nargout>1, error('Too many output arguments'), end -check_meth={'ma','eu','mi','nr','rr','fa','in','om','op','di'}; % maxnorm, euclidean, nrmnorm, fan, distance +check_meth={'ma','eu','mi','nr','rr','fa','in','om','op','le','dt','di'}; % maxnorm, euclidean, nrmnorm, fan, distance check_norm={'non','nor'}; % nonormalize, normalize check_gui={'gui','nog','sil'}; % gui, nogui, silent @@ -605,7 +608,7 @@ switch(action) 'Tag','Unthresh',... 'ToolTip','Switch between thresholded and unthresholded CRP.' ); - if method==10, set(h0,'Value',1); end + if method==12, set(h0,'Value',1); end if method==8 | method==9, set(h0,'Enable','Off'); end h1=uicontrol(props.popup, ... % Button Unthresholded Scale @@ -618,17 +621,17 @@ switch(action) 'Tag','Log',... 'ToolTip','Switch between various scaled CRP.' ); - if method==10, set(h1,'Enable','On'); end + if method==12, set(h1,'Enable','On'); end h2=uicontrol(props.popup,... % Input Neighbourhood Method 'Units','Normalized',... - 'String','Maximum Norm|Euclidean Norm|Minimum Norm|Normalized Norm|Fixed RR|Fixed Amount|Interdependent|Order Matrix|Order Pattern',... + 'String','Maximum Norm|Euclidean Norm|Minimum Norm|Normalized Norm|Fixed RR|Fixed Amount|Interdependent|Order Matrix|Order Pattern|Levenshtein|DTW',... 'Position',[.16 .509 .67 .032],... 'CallBack','crp2 unthresh',... 'Tag','Method',... 'ToolTip','Select the method of finding neighbours.'); - if method==10, set(h2,'Enable','Off'); else, set(h2,'Value',method); end + if method==12, set(h2,'Enable','Off'); else, set(h2,'Value',method); end h0=uicontrol(props.text,... % Text Threshold 'Units','Normalized',... @@ -637,7 +640,7 @@ switch(action) 'Position',[.16 .462 .35 .02]); h1=get(h0,'Extent'); h2=get(h0,'Position'); set(h0,'Position',[h2(1) h2(2) h2(3) h1(4)]) - if method==10 | method==9, set(h0,'Enable','Off'); end + if method==12 | method==9, set(h0,'Enable','Off'); end h0=uicontrol(props.edit,... % Input Threshold @@ -649,7 +652,7 @@ switch(action) 'ToolTip','Insert the size of neighbourhood.' ); h1=get(h0,'Extent'); h2=get(h0,'Position'); set(h0,'Position',[h2(1) h2(2) h2(3) h1(4)]) - if method==10 | method==9, set(h0,'Enable','Off'); end + if method==12 | method==9, set(h0,'Enable','Off'); end dark_factor=.86; h0=uicontrol(props.frame,'BackgroundColor',dark_factor*props.frame.BackgroundColor, ... % Frame LOSsearch @@ -1202,6 +1205,31 @@ switch(action) matext=''; + %%%%%%%%%%%%%%%%% Levenshtein + + case 10 + + errcode=120; + + set(findobj('Tag','Status','Parent',findobj('Parent',hCRP,'Tag','CRPPlot')),'String','Compute Distance Matrix'),drawnow + s1 = levenshtein(x1, y1); + X = reshape(s1,Ny,Nx); + matext=''; + + + %%%%%%%%%%%%%%%%% DTW + + case 11 + + errcode=121; + + set(findobj('Tag','Status','Parent',findobj('Parent',hCRP,'Tag','CRPPlot')),'String','Compute Distance Matrix'),drawnow + s1 = dtw(x1, y1); + X = reshape(s1,Ny,Nx); + matext=''; + + + %%%%%%%%%%%%%%%%% global CRP case length(check_meth)