Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
toolbox
Commits
c64cc4d0
Commit
c64cc4d0
authored
8 years ago
by
Marco Berzborn
Browse files
Options
Downloads
Patches
Plain Diff
fix for R2017a and some rework in itaSuper
parent
2b7baf3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/ClassStuff/@itaSuper/itaSuper.m
+15
-14
15 additions, 14 deletions
kernel/ClassStuff/@itaSuper/itaSuper.m
with
15 additions
and
14 deletions
kernel/ClassStuff/@itaSuper/itaSuper.m
+
15
−
14
View file @
c64cc4d0
...
@@ -142,7 +142,7 @@ classdef itaSuper < itaMeta
...
@@ -142,7 +142,7 @@ classdef itaSuper < itaMeta
fieldName
=
fieldnames
(
varargin
{
1
});
fieldName
=
fieldnames
(
varargin
{
1
});
end
end
end
end
for
ind
=
1
:
numel
(
fieldName
)
;
for
ind
=
1
:
numel
(
fieldName
)
try
try
this
.
(
fieldName
{
ind
})
=
varargin
{
1
}
.
(
fieldName
{
ind
});
this
.
(
fieldName
{
ind
})
=
varargin
{
1
}
.
(
fieldName
{
ind
});
catch
errmsg
catch
errmsg
...
@@ -166,8 +166,7 @@ classdef itaSuper < itaMeta
...
@@ -166,8 +166,7 @@ classdef itaSuper < itaMeta
end
end
function
this
=
set
.
time
(
this
,
value
)
function
this
=
set
.
time
(
this
,
value
)
dimensionsValue
=
size
(
value
);
dimensionsValue
=
size
(
value
);
nSamples
=
dimensionsValue
(
1
);
this
.
timeData
=
reshape
(
value
,
dimensionsValue
(
1
),
[]);
this
.
timeData
=
reshape
(
value
,
nSamples
,
[]);
this
.
dimensions
=
dimensionsValue
(
2
:
end
);
this
.
dimensions
=
dimensionsValue
(
2
:
end
);
end
end
function
result
=
get
.
freq
(
this
)
function
result
=
get
.
freq
(
this
)
...
@@ -176,8 +175,7 @@ classdef itaSuper < itaMeta
...
@@ -176,8 +175,7 @@ classdef itaSuper < itaMeta
end
end
function
this
=
set
.
freq
(
this
,
value
)
function
this
=
set
.
freq
(
this
,
value
)
dimensionsValue
=
size
(
value
);
dimensionsValue
=
size
(
value
);
nBins
=
dimensionsValue
(
1
);
this
.
freqData
=
reshape
(
value
,
dimensionsValue
(
1
),
[]);
this
.
freqData
=
reshape
(
value
,
nBins
,
[]);
this
.
dimensions
=
dimensionsValue
(
2
:
end
);
this
.
dimensions
=
dimensionsValue
(
2
:
end
);
end
end
...
@@ -467,7 +465,7 @@ classdef itaSuper < itaMeta
...
@@ -467,7 +465,7 @@ classdef itaSuper < itaMeta
else
else
this
.
mDataTypeEqual
=
false
;
this
.
mDataTypeEqual
=
false
;
end
end
if
str
match
(
'int'
,
value
)
if
str
cmp
(
'int'
,
value
)
ita_verbose_info
(
'Sorry, but
''
int
''
is really dangerous for dataTypeOutput, please use double or single.'
,
1
)
ita_verbose_info
(
'Sorry, but
''
int
''
is really dangerous for dataTypeOutput, please use double or single.'
,
1
)
end
end
end
end
...
@@ -599,7 +597,7 @@ classdef itaSuper < itaMeta
...
@@ -599,7 +597,7 @@ classdef itaSuper < itaMeta
% and select the appropriate Channel struct(s)
% and select the appropriate Channel struct(s)
%% merge channelInfo
%% merge channelInfo
channelFields
=
this
.
fields
;
channelFields
=
this
.
fields
;
channelFields
=
channelFields
(
str
match
(
'channel'
,
channelFields
));
channelFields
=
channelFields
(
str
cmp
(
'channel'
,
channelFields
));
for
idchfield
=
1
:
numel
(
channelFields
)
for
idchfield
=
1
:
numel
(
channelFields
)
thisFieldName
=
channelFields
{
idchfield
};
thisFieldName
=
channelFields
{
idchfield
};
...
@@ -663,7 +661,7 @@ classdef itaSuper < itaMeta
...
@@ -663,7 +661,7 @@ classdef itaSuper < itaMeta
%% merge channelInfo
%% merge channelInfo
channelFields
=
this
.
fields
;
channelFields
=
this
.
fields
;
channelFields
=
channelFields
(
str
match
(
'channel'
,
channelFields
));
channelFields
=
channelFields
(
str
cmp
(
'channel'
,
channelFields
));
for
idchfield
=
1
:
numel
(
channelFields
)
for
idchfield
=
1
:
numel
(
channelFields
)
thisFieldName
=
channelFields
{
idchfield
};
thisFieldName
=
channelFields
{
idchfield
};
...
@@ -758,7 +756,7 @@ classdef itaSuper < itaMeta
...
@@ -758,7 +756,7 @@ classdef itaSuper < itaMeta
[
sArgs
]
=
ita_parse_arguments
(
struct
(
'log_prefix'
,[]),
varargin
);
[
sArgs
]
=
ita_parse_arguments
(
struct
(
'log_prefix'
,[]),
varargin
);
%get logarithmic frequency data 20*log10(abs(Obj.freq)/referenceValue)
%get logarithmic frequency data 20*log10(abs(Obj.freq)/referenceValue)
[
x
,
refValues
,
log_prefix
]
=
itaValue
.
log_reference
(
this
.
channelUnits
);
[
~
,
refValues
,
log_prefix
]
=
itaValue
.
log_reference
(
this
.
channelUnits
);
if
sArgs
.
log_prefix
if
sArgs
.
log_prefix
log_prefix
=
sArgs
.
log_prefix
;
log_prefix
=
sArgs
.
log_prefix
;
end
end
...
@@ -772,7 +770,7 @@ classdef itaSuper < itaMeta
...
@@ -772,7 +770,7 @@ classdef itaSuper < itaMeta
[
sArgs
]
=
ita_parse_arguments
(
struct
(
'log_prefix'
,[]),
varargin
);
[
sArgs
]
=
ita_parse_arguments
(
struct
(
'log_prefix'
,[]),
varargin
);
%get logarithmic frequency data 20*log10(abs(Obj.freq)/referenceValue)
%get logarithmic frequency data 20*log10(abs(Obj.freq)/referenceValue)
[
x
,
refValues
,
log_prefix
]
=
itaValue
.
log_reference
(
this
.
channelUnits
);
[
~
,
refValues
,
log_prefix
]
=
itaValue
.
log_reference
(
this
.
channelUnits
);
if
sArgs
.
log_prefix
if
sArgs
.
log_prefix
log_prefix
=
sArgs
.
log_prefix
;
log_prefix
=
sArgs
.
log_prefix
;
end
end
...
@@ -856,7 +854,7 @@ classdef itaSuper < itaMeta
...
@@ -856,7 +854,7 @@ classdef itaSuper < itaMeta
methods
(
Hidden
=
true
)
methods
(
Hidden
=
true
)
function
res
=
legend
(
this
,
varargin
)
function
res
=
legend
(
this
,
varargin
)
% build a cell of strings for the plot legend
% build a cell of strings for the plot legend
if
nargin
==
1
;
if
nargin
==
1
mode
=
'log'
;
mode
=
'log'
;
else
else
mode
=
varargin
{
1
};
mode
=
varargin
{
1
};
...
@@ -864,7 +862,8 @@ classdef itaSuper < itaMeta
...
@@ -864,7 +862,8 @@ classdef itaSuper < itaMeta
channelNames
=
this
.
channelNames
;
channelNames
=
this
.
channelNames
;
channelUnits
=
this
.
channelUnits
;
channelUnits
=
this
.
channelUnits
;
channelUnits
(
strcmpi
(
channelUnits
,
''
))
=
{
'1'
};
channelUnits
(
strcmpi
(
channelUnits
,
''
))
=
{
'1'
};
res
=
{};
% res = {};
res
=
cell
(
1
,
this
.
nChannels
);
for
idx
=
1
:
this
.
nChannels
for
idx
=
1
:
this
.
nChannels
if
strcmpi
(
mode
,
'nodb'
)
if
strcmpi
(
mode
,
'nodb'
)
res
{
idx
}
=
[
channelNames
{
idx
}
' ['
channelUnits
{
idx
}
']'
];
res
{
idx
}
=
[
channelNames
{
idx
}
' ['
channelUnits
{
idx
}
']'
];
...
@@ -876,6 +875,7 @@ classdef itaSuper < itaMeta
...
@@ -876,6 +875,7 @@ classdef itaSuper < itaMeta
end
end
end
end
% TODO What is this supposed to do?
function
res
=
log_reference
(
this
)
function
res
=
log_reference
(
this
)
end
end
...
@@ -1012,6 +1012,7 @@ classdef itaSuper < itaMeta
...
@@ -1012,6 +1012,7 @@ classdef itaSuper < itaMeta
disp
(
this
.
LINE_END
);
disp
(
this
.
LINE_END
);
end
end
function
displayEndOfClass
(
this
,
classname
,
firstStr
)
function
displayEndOfClass
(
this
,
classname
,
firstStr
)
% TODO why?
if
exist
(
'firstStr'
,
'var'
)
if
exist
(
'firstStr'
,
'var'
)
end
end
classnameString
=
[
'('
classname
')'
];
classnameString
=
[
'('
classname
')'
];
...
@@ -1024,7 +1025,7 @@ classdef itaSuper < itaMeta
...
@@ -1024,7 +1025,7 @@ classdef itaSuper < itaMeta
if
nargin
==
1
% only get
if
nargin
==
1
% only get
for
idx
=
1
:
size
(
this
,
1
)
for
idx
=
1
:
size
(
this
,
1
)
for
jdx
=
1
:
size
(
this
,
2
)
for
jdx
=
1
:
size
(
this
,
2
)
for
ndx
=
1
:
this
(
idx
,
jdx
)
.
nChannels
;
for
ndx
=
1
:
this
(
idx
,
jdx
)
.
nChannels
result
(
idx
,
jdx
,
ndx
)
=
itaValue
(
1
,
this
(
idx
,
jdx
)
.
channelUnits
{
ndx
});
result
(
idx
,
jdx
,
ndx
)
=
itaValue
(
1
,
this
(
idx
,
jdx
)
.
channelUnits
{
ndx
});
end
end
end
end
...
@@ -1032,7 +1033,7 @@ classdef itaSuper < itaMeta
...
@@ -1032,7 +1033,7 @@ classdef itaSuper < itaMeta
else
% set values
else
% set values
for
idx
=
1
:
size
(
this
,
1
)
for
idx
=
1
:
size
(
this
,
1
)
for
jdx
=
1
:
size
(
this
,
2
)
for
jdx
=
1
:
size
(
this
,
2
)
for
ndx
=
1
:
this
(
idx
,
jdx
)
.
nChannels
;
for
ndx
=
1
:
this
(
idx
,
jdx
)
.
nChannels
this
(
idx
,
jdx
,
ndx
)
.
channelUnits
{
ndx
}
=
value
(
idx
,
jdx
);
this
(
idx
,
jdx
,
ndx
)
.
channelUnits
{
ndx
}
=
value
(
idx
,
jdx
);
end
end
end
end
...
...
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