Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CRP Toolbox for MATLAB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Norbert Marwan
CRP Toolbox for MATLAB
Commits
972ebff7
Commit
972ebff7
authored
16 years ago
by
marwan
Browse files
Options
Downloads
Patches
Plain Diff
silent ability added, minor bug fixes
parent
915e086a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
twinsurr.m
+13
-4
13 additions, 4 deletions
twinsurr.m
with
13 additions
and
4 deletions
twinsurr.m
+
13
−
4
View file @
972ebff7
...
...
@@ -33,6 +33,9 @@ function y = twinsurr(varargin)
% $Revision$
%
% $Log$
% Revision 5.1 2008/07/01 13:09:27 marwan
% initial import
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% programme properties
...
...
@@ -40,6 +43,7 @@ global errcode props
init_properties
nsur_init
=
100
;
sil
=
0
;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% check the input
...
...
@@ -73,21 +77,26 @@ i_double=find(cellfun('isclass',varargin,'double'));
i_char
=
find
(
cellfun
(
'isclass'
,
varargin
,
'char'
));
check_meth
=
{
'ma'
,
'eu'
,
'mi'
,
'nr'
,
'rr'
,
'fa'
,
'in'
,
'om'
,
'op'
,
'di'
};
% maxnorm, euclidean, nrmnorm, fan, distance
check_norm
=
{
'non'
,
'nor'
};
% nonormalize, normalize
check_sil
=
{
've'
,
'si'
};
% verbose, silent
if
isnumeric
(
varargin
{
1
})
% read commandline input
% check the text input parameters for method, gui
temp_meth
=
0
;
temp_norm
=
0
;
temp_sil
=
0
;
if
~
isempty
(
i_char
)
for
i
=
1
:
length
(
i_char
),
varargin
{
i_char
(
i
)}(
4
)
=
'0'
;
temp_norm
=
temp_norm
+
strcmpi
(
varargin
{
i_char
(
i
)}(
1
:
3
),
check_norm
'
);
temp_meth
=
temp_meth
+
strcmpi
(
varargin
{
i_char
(
i
)}(
1
:
2
),
check_meth
'
);
temp_sil
=
temp_sil
+
strcmpi
(
varargin
{
i_char
(
i
)}(
1
:
2
),
check_sil
'
);
end
method_n
=
min
(
find
(
temp_meth
));
nonorm
=
min
(
find
(
temp_norm
))
-
1
;
sil
=
min
(
find
(
temp_sil
))
-
1
;
for
i
=
1
:
length
(
i_char
);
temp2
(
i
,:)
=
varargin
{
i_char
(
i
)}(
1
:
3
);
end
if
isempty
(
sil
),
sil
=
0
;
end
if
isempty
(
nonorm
),
nonorm
=
1
;
end
if
nonorm
>
1
,
nonorm
=
1
;
end
if
isempty
(
method_n
),
method_n
=
1
;
end
...
...
@@ -117,9 +126,9 @@ else
end
N
=
length
(
x
);
if
size
(
x
,
1
)
<
size
(
x
,
2
),
x
=
x
'
;
end
m
=
size
(
x
,
2
);
N
=
length
(
x
);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% make surrogates
...
...
@@ -128,12 +137,12 @@ X = crp(x,m,t,e,method,norm_str,'sil');
NX
=
length
(
X
);
%% find twins
h
=
waitbar
(
0
,
'Searching Twins'
);
for
i
=
1
:
NX
,
waitbar
(
i
/
NX
)
if
~
sil
,
h
=
waitbar
(
0
,
'Searching Twins'
);
end
for
i
=
1
:
NX
,
if
~
sil
,
waitbar
(
i
/
NX
)
;
end
A
=
repmat
(
X
(:,
i
),
1
,
NX
);
S
{
i
}
=
find
(
all
(
X
==
A
));
end
delete
(
h
)
if
~
sil
,
delete
(
h
)
;
end
for
k
=
1
:
nsur
%% chose randomly first point
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment