Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
function [X, matext] = crp_plugin(x, y, m, t, e, mflag, hCRP, plugin_path, silent)
% CRP_PLUGIN Loads and executes the extern plugin
% Used by CRP Toolbox
% Copyright (c) 2005 by AMRON
% Norbert Marwan, Potsdam University, Germany
% http://www.agnld.uni-potsdam.de
%
% $Date$
% $Revision$
%
% $Log$
%
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or any later version.
global errcode
X = []; matext = '';
try
tmp_xdatafile = tempname;
tmp_ydatafile = tempname;
tmp_rpdatafile = tempname;
if ~silent, set(findobj('Tag','Status','Parent',findobj('Parent',hCRP,'Tag','CRPPlot')),'String','Export Data'),drawnow, end
save(tmp_xdatafile,'x','-ascii','-tabs');
save(tmp_ydatafile,'y','-ascii','-tabs');
% call extern rp programme
if ~silent, set(findobj('Tag','Status','Parent',findobj('Parent',hCRP,'Tag','CRPPlot')),'String','Compute Recurrence Points'),drawnow, end
m_str = {'MAX', 'EUC', 'MIN', '', '', '', '', '', 'EUC'};
dis_sign = 1; if mflag == 9, dis_sign = -1; end
system([plugin_path,filesep,'rp -m ',num2str(1), ...
' -t ',num2str(1), ...
' -e ',num2str(dis_sign * e), ...
' -n ',m_str{mflag}, ...
' -w ',num2str(0), ...
' -i ',tmp_xdatafile, ...
' -j ',tmp_ydatafile, ...
' -r ',tmp_rpdatafile, ...
' -f TIF', ...
' -s']);
% import rp
if ~silent, set(findobj('Tag','Status','Parent',findobj('Parent',hCRP,'Tag','CRPPlot')),'String','Import Recurrence Points'),drawnow, end
X = imread(tmp_rpdatafile);
X = (double(X)/65535);
delete(tmp_rpdatafile);
delete(tmp_xdatafile);
delete(tmp_ydatafile);
if ~silent, set(findobj('Tag','Status','Parent',findobj('Parent',hCRP,'Tag','CRPPlot')),'String','Plot Recurrence Points'),drawnow, end
switch mflag
case 1
%%%%%%%%%%%%%%%%% maximum norm
matext=[num2str(round(100*e)/100) '\sigma (fixed distance maximum norm)'];
case 2
%%%%%%%%%%%%%%%%% euclidean norm
errcode=112;
matext=[num2str(round(100*e)/100) '\sigma (fixed distance euclidean norm)'];
case 3
%%%%%%%%%%%%%%%%% minimum norm
errcode=113;
matext=[num2str(round(100*e)/100) '\sigma (fixed distance minimum norm)'];
%%%%%%%%%%%%%%%%% global RP
case 9
X = X * ( max([max(x), max(y)]) - min([min(x), min(y)]) );
matext='';
end
catch
warning off
delete(tmp_rpdatafile);
delete(tmp_xdatafile);
delete(tmp_ydatafile);
warning on
end