Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
7da59827
Commit
7da59827
authored
Jun 06, 2017
by
Marco Berzborn
Browse files
added option to force complex interpretation of data in itaCoordinates.surf (phase plots)
parent
6bf10a5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
kernel/ClassStuff/@itaCoordinates/surf.m
View file @
7da59827
...
...
@@ -38,16 +38,19 @@ function varargout = surf(this, varargin)
% Author:
% Martin Pollow, mpo@akustik.rwth-aachen.de, 4.1.2010
narginchk
(
1
,
inf
);
defaultProperties
=
{
'EdgeAlpha'
,
0
,
'FaceColor'
,
'interp'
};
sArgs
=
struct
(
'pos1_data'
,
'double'
,
'radius'
,
[],
'magnitude'
,
0
,
defaultProperties
{:},
'parent'
,[]);
if
~
isempty
(
varargin
)
[
data
,
sArgs
]
=
ita_parse_arguments
(
sArgs
,
varargin
);
end
defaultProperties
=
{
'EdgeAlpha'
,
0
,
...
'FaceColor'
,
'interp'
};
numArgIn
=
nargin
;
sArgs
=
struct
(
'pos1_data'
,
'double'
,
...
'radius'
,
[],
...
'magnitude'
,
0
,
...
'parent'
,
[],
...
'complex'
,
false
,
...
'colorbar'
,
true
,
...
defaultProperties
{:});
[
data
,
sArgs
]
=
ita_parse_arguments
(
sArgs
,
varargin
);
if
sArgs
.
magnitude
data
=
abs
(
data
);
...
...
@@ -64,7 +67,7 @@ end
% parent = varargin{2};
% varargin = varargin(3:end);
% end
if
(
n
umA
rg
I
n
==
1
)
if
(
n
a
rg
i
n
==
1
)
% only coordinates given
r
=
this
.
r
;
color
=
zeros
(
size
(
r
));
...
...
@@ -76,7 +79,7 @@ else
else
r
=
data
.'
;
end
isComplex
=
~
all
(
isreal
(
r
))
;
% & min(r(:)) < 0;
isComplex
=
~
all
(
isreal
(
r
))
||
sArgs
.
complex
;
if
isComplex
% if the radius is complex, set the color
color
=
mod
(
angle
(
r
),
2
*
pi
);
...
...
@@ -193,15 +196,19 @@ switch colorbar_settings
case
'geometry'
% do nothing
case
'complex'
colormap
hsv
colorbar
;
colormap
(
hsv
)
if
sArgs
.
colorbar
colorbar
;
end
caxis
([
0
2
*
pi
]);
case
'magnitude'
colormap
jet
% caxis([0 max(color)]);
if
min
(
color
)
<
max
(
color
)
caxis
([
min
(
color
)
max
(
color
)]);
colorbar
;
if
sArgs
.
colorbar
colorbar
;
end
elseif
all
(
isfinite
(
color
))
caxis
([
0
max
(
color
)]);
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment