From 978f6406a75e2c118690d6217018646ec9bbf950 Mon Sep 17 00:00:00 2001
From: marwan <>
Date: Fri, 12 Nov 2004 08:40:46 +0000
Subject: [PATCH] order patterns recurrence plot added

---
 crqa.m  | 20 +++++++++++++++-----
 crqad.m | 14 +++++++++++---
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/crqa.m b/crqa.m
index d7154d3..8854ef8 100644
--- a/crqa.m
+++ b/crqa.m
@@ -56,7 +56,8 @@ function xout=crqa(varargin)
 %                    (all vectors have the length one).
 %      fan         - Fixed amount of nearest neighbours.
 %      inter       - Interdependent neighbours.
-%      distance    - Distance coded matrix (global CRP, Euclidean norm).
+%      omatrix     - Order matrix.
+%      opattern    - Order patterns recurrence plot.
 %
 %    Normalization of the data series.
 %      normalize   - Normalization of the data.
@@ -134,6 +135,9 @@ function xout=crqa(varargin)
 % $Revision$
 %
 % $Log$
+% Revision 5.5  2004/11/10 07:04:50  marwan
+% initial import
+%
 %
 % This program is part of the new generation XXII series.
 %
@@ -178,7 +182,7 @@ errcode=1;
    w=[];wstep=0; method='max'; method_n=1;
    embed_flag=1;
    nogui=0;
-      check_meth={'ma','eu','mi','nr','fa','in','di'}; 	% maxnorm, euclidean, nrmnorm,  fan, distance
+      check_meth={'ma','eu','mi','nr','fa','in','om','op','di'}; 	% maxnorm, euclidean, nrmnorm,  fan, distance
       check_gui={'gui','nog','sil'};		% gui, nogui, silent
       check_norm={'non','nor'};			% nonormalize, normalize
    
@@ -195,7 +199,7 @@ errcode=1;
      h=findobj('Tag','crqa_eps');
      e=str2num(get(h(1),'String'));
      h=findobj('Tag','crqa_method');
-     method={'Maximum Norm','Euclidean Norm','Minimum Norm','Normalized Norm','FAN','Interdependent'};
+     method={'Maximum Norm','Euclidean Norm','Minimum Norm','Normalized Norm','FAN','Interdependent','Order Matrix','Order Pattern','Distance Plot'};
      method=method{get(h(1),'Value')};
      nonorm=get(h(1),'UserData');
      h=findobj('Tag','crqa_lmin');
@@ -232,7 +236,7 @@ errcode=1;
          if isempty(nogui), nogui=0; end
          if isempty(method_n), method_n=1; end
          if nogui>2, nogui=1; end
-         if method_n>7, method0=7; end
+         if method_n>length(check_meth), method0=length(check_meth); end
          method=check_meth{method_n};
       else
          nogui=0;
@@ -570,7 +574,7 @@ case 'init'
             'Tag','crqa_method',...
 	    'UserData',nonorm,...
 	    'Value',method_n,...
-	    'String','Maximum Norm|Euclidean Norm|Minimum Norm|Normalized Norm|Fixed Amount|Interdependent',...
+	    'String','Maximum Norm|Euclidean Norm|Minimum Norm|Normalized Norm|Fixed Amount|Interdependent|Order Matrix|Order Patterns|Distance Plot',...
             'Position',[89+30 24.6+.2+2.5 22  1.7]);    
 
   h=uicontrol(props.text,...
@@ -777,6 +781,12 @@ case 'store'
 case 'compute'
 
   errcode=11;
+  
+  if length(method)>1 & strcmpi(method(1:3),'dis')
+      disp('Warning: RQA from distance plot not possible!')
+      return
+  end
+  
   if ~nogui
     h_fig=findobj('tag','crqa_Fig');
     setptr(gcf,'watch'), 
diff --git a/crqad.m b/crqad.m
index 9ababe9..8262890 100644
--- a/crqad.m
+++ b/crqad.m
@@ -34,7 +34,8 @@ function out=crqad(varargin)
 %                    (all vectors have the length one).
 %      fan         - Fixed amount of nearest neighbours.
 %      inter       - Interdependent neighbours.
-%      distance    - Distance coded matrix (global CRP, Euclidean norm).
+%      omatrix     - Order matrix.
+%      opattern    - Order patterns recurrence plot.
 %
 %    Normalization of the data series.
 %      normalize   - Normalization of the data.
@@ -69,6 +70,9 @@ function out=crqad(varargin)
 % $Revision$
 %
 % $Log$
+% Revision 2.2  2004/11/10 07:05:55  marwan
+% initial import
+%
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% programme properties
@@ -100,7 +104,7 @@ splash_gpl('crp');
    if nargin & isnumeric(varargin{1})
 
      % check the text input parameters for method, gui 
-      check_meth={'ma','eu','nr','fa','in','di'}; 	% maxnorm, euclidean, nrmnorm,  fan, distance
+      check_meth={'ma','eu','mi','nr','fa','in','om','op','di'}; 	% maxnorm, euclidean, nrmnorm,  fan, distance
       check_gui={'gui','nog','sil'};		% gui, nogui, silent
       temp_meth=0;
       temp_gui=0;
@@ -117,7 +121,7 @@ splash_gpl('crp');
          if isempty(nogui), nogui=0; end
          if isempty(method_n), method_n=1; end
          if nogui>2, nogui=1; end
-         if method_n>6, method0=6; end
+         if method_n>length(check_meth), method0=length(check_meth); end
          method=check_meth{method_n};
       else
          nogui=0;
@@ -218,6 +222,10 @@ splash_gpl('crp');
 flag=1;
 
 x1=x; x2=y;
+  if length(method)>1 & strcmpi(method(1:2),'di')
+      disp('Warning: RQA from distance plot not possible!')
+      return
+  end
 
 warning off
 if size(x1,1)<size(x1,2), x1=x1'; end
-- 
GitLab