Skip to content
GitLab
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
49c8abe3
Commit
49c8abe3
authored
Feb 09, 2017
by
Marco Berzborn
Browse files
bugfix R2017a beta
classObject.fields was undocumented feature, replaced with properties(classObject)
parent
c64cc4d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
kernel/ClassStuff/@itaSuper/itaSuper.m
View file @
49c8abe3
...
...
@@ -465,7 +465,7 @@ classdef itaSuper < itaMeta
else
this
.
mDataTypeEqual
=
false
;
end
if
strcmp
(
'int'
,
value
)
if
str
n
cmp
(
'int'
,
value
,
3
)
ita_verbose_info
(
'Sorry, but
''
int
''
is really dangerous for dataTypeOutput, please use double or single.'
,
1
)
end
end
...
...
@@ -499,11 +499,12 @@ classdef itaSuper < itaMeta
%result = prod(dims(2:end));
result
=
prod
(
this
.
dimensions
(:));
end
function
res
=
get_diag
(
this
)
for
idx
=
1
:
size
(
this
,
1
)
res
(
idx
)
=
this
(
idx
,
idx
);
end
% use eye as mask for diagonal
res
=
this
(
eye
(
size
(
this
,
1
)));
end
function
this
=
diag
(
this
,
diagonalshift
,
blocksize
)
%diagonal of matrix, or build diagonal matrix out of vector
if
nargin
==
1
||
isempty
(
diagonalshift
)
...
...
@@ -596,12 +597,12 @@ classdef itaSuper < itaMeta
% and select the appropriate Channel struct(s)
%% merge channelInfo
channelFields
=
this
.
fields
;
channelFields
=
properties
(
this
)
;
channelFields
=
channelFields
(
strcmp
(
'channel'
,
channelFields
));
for
idchfield
=
1
:
numel
(
channelFields
)
thisFieldName
=
channelFields
{
idchfield
};
if
any
(
str
match
(
'split'
,
methods
(
this
.
(
thisFieldName
))
,
'exact'
))
% Check if it has a split-function
if
any
(
str
cmp
(
'split'
,
methods
(
this
.
(
thisFieldName
))))
% Check if it has a split-function
result
.
(
thisFieldName
)
=
split
(
this
.
(
thisFieldName
),
index
);
else
% just use cat
result
.
(
thisFieldName
)
=
this
.
(
thisFieldName
)(
index
);
...
...
@@ -660,12 +661,12 @@ classdef itaSuper < itaMeta
this
.
data
=
[
this
.
data
this2
.
data
];
%% merge channelInfo
channelFields
=
this
.
fields
;
channelFields
=
properties
(
this
)
;
channelFields
=
channelFields
(
strcmp
(
'channel'
,
channelFields
));
for
idchfield
=
1
:
numel
(
channelFields
)
thisFieldName
=
channelFields
{
idchfield
};
if
any
(
str
match
(
'merge'
,
methods
(
this
.
(
thisFieldName
))
,
'exact'
))
% Check if it has a merge-function
if
any
(
str
cmp
(
'merge'
,
methods
(
this
.
(
thisFieldName
))))
% Check if it has a merge-function
this
.
(
thisFieldName
)
=
merge
(
split
(
this
.
(
thisFieldName
),(
1
:
thischannels
)),
this2
.
(
thisFieldName
));
else
% just use cat
this
.
(
thisFieldName
)
=
[
this
.
(
thisFieldName
)(
1
:
thischannels
);
this2
.
(
thisFieldName
)(:)];
...
...
@@ -859,30 +860,29 @@ classdef itaSuper < itaMeta
else
mode
=
varargin
{
1
};
end
channelNames
=
this
.
channelNames
;
channelUnits
=
this
.
channelUnits
;
channelUnits
(
strcmpi
(
channelUnits
,
''
))
=
{
'1'
};
% res = {};
tmp_channelNames
=
this
.
channelNames
;
tmp_channelUnits
=
this
.
channelUnits
;
tmp_channelUnits
(
strcmpi
(
tmp_channelUnits
,
''
))
=
{
'1'
};
res
=
cell
(
1
,
this
.
nChannels
);
for
idx
=
1
:
this
.
nChannels
if
strcmpi
(
mode
,
'nodb'
)
res
{
idx
}
=
[
channelNames
{
idx
}
' ['
channelUnits
{
idx
}
']'
];
res
{
idx
}
=
[
tmp_
channelNames
{
idx
}
' ['
tmp_
channelUnits
{
idx
}
']'
];
elseif
strcmpi
(
mode
,
'nothing'
)
res
{
idx
}
=
[
channelNames
{
idx
}];
res
{
idx
}
=
[
tmp_
channelNames
{
idx
}];
else
res
{
idx
}
=
[
channelNames
{
idx
}
' [dB re '
itaValue
.
log_reference
(
channelUnits
{
idx
})
']'
];
res
{
idx
}
=
[
tmp_
channelNames
{
idx
}
' [dB re '
itaValue
.
log_reference
(
tmp_
channelUnits
{
idx
})
']'
];
end
end
end
% TODO What is this supposed to do?
function
res
=
log_reference
(
this
)
end
%
function res = log_reference(this)
%
%
end
function
result
=
get_data
(
this
)
if
~
this
.
mDataTypeEqual
||
any
(
this
.
mDataFactor
~=
1
)
if
str
match
(
'int'
,
this
.
dataTypeOutput
)
if
str
ncmp
(
'int'
,
this
.
dataTypeOutput
,
3
)
result
=
cast
(
this
.
mData
,
this
.
dataTypeOutput
);
else
result
=
cast
(
this
.
mData
,
this
.
dataTypeOutput
)
.*
this
.
mDataFactor
;
...
...
@@ -895,7 +895,7 @@ classdef itaSuper < itaMeta
% this functions is needed for class itaAudioDevNull
% and for the check of even number of samples
if
~
isa
(
value
,
this
.
dataType
)
if
any
(
str
match
(
'int'
,
this
.
dataType
))
&&
~
any
(
str
match
(
'int'
,
this
.
dataTypeOutput
))
if
any
(
str
ncmp
(
'int'
,
this
.
dataType
,
3
))
&&
~
any
(
str
cmp
(
'int'
,
this
.
dataTypeOutput
,
3
))
this
.
dataFactor
=
double
(
max
(
max
(
abs
(
value
))))
.
/
(
double
(
intmax
(
this
.
dataType
))
-
1
);
value
=
value
.
/
this
.
mDataFactor
;
end
...
...
@@ -1011,10 +1011,7 @@ classdef itaSuper < itaMeta
function
displayLineEnd
(
this
)
disp
(
this
.
LINE_END
);
end
function
displayEndOfClass
(
this
,
classname
,
firstStr
)
% TODO why?
if
exist
(
'firstStr'
,
'var'
)
end
function
displayEndOfClass
(
this
,
classname
)
classnameString
=
[
'('
classname
')'
];
result
=
repmat
(
' '
,
1
,
length
(
this
.
LINE_START
)
-
length
(
classnameString
));
disp
([
result
classnameString
]);
...
...
@@ -1068,10 +1065,10 @@ classdef itaSuper < itaMeta
function
dimString
=
dimString
(
this
)
% get a nice dimension string
dimString
=
[];
dimensions
=
this
.
dimensions
;
for
ind
=
1
:
numel
(
dimensions
)
dimString
=
[
dimString
num2str
(
dimensions
(
ind
))];
%#ok<AGROW>
if
ind
<
numel
(
dimensions
)
tmp_
dimensions
=
this
.
dimensions
;
for
ind
=
1
:
numel
(
tmp_
dimensions
)
dimString
=
[
dimString
num2str
(
tmp_
dimensions
(
ind
))];
%#ok<AGROW>
if
ind
<
numel
(
tmp_
dimensions
)
dimString
=
[
dimString
' x '
];
%#ok<AGROW>
end
end
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment