Commit 49c8abe3 authored by Marco Berzborn's avatar Marco Berzborn
Browse files

bugfix R2017a beta

classObject.fields was undocumented feature, replaced with
properties(classObject)
parent c64cc4d0
...@@ -465,7 +465,7 @@ classdef itaSuper < itaMeta ...@@ -465,7 +465,7 @@ classdef itaSuper < itaMeta
else else
this.mDataTypeEqual = false; this.mDataTypeEqual = false;
end end
if strcmp('int',value) if strncmp('int', value, 3)
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
...@@ -499,11 +499,12 @@ classdef itaSuper < itaMeta ...@@ -499,11 +499,12 @@ classdef itaSuper < itaMeta
%result = prod(dims(2:end)); %result = prod(dims(2:end));
result = prod(this.dimensions(:)); result = prod(this.dimensions(:));
end end
function res = get_diag(this) function res = get_diag(this)
for idx = 1:size(this,1) % use eye as mask for diagonal
res(idx) = this(idx,idx); res = this(eye(size(this,1)));
end
end end
function this = diag(this,diagonalshift,blocksize) function this = diag(this,diagonalshift,blocksize)
%diagonal of matrix, or build diagonal matrix out of vector %diagonal of matrix, or build diagonal matrix out of vector
if nargin == 1 || isempty(diagonalshift) if nargin == 1 || isempty(diagonalshift)
...@@ -596,12 +597,12 @@ classdef itaSuper < itaMeta ...@@ -596,12 +597,12 @@ 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 = properties(this);
channelFields = channelFields(strcmp('channel',channelFields)); channelFields = channelFields(strcmp('channel',channelFields));
for idchfield = 1:numel(channelFields) for idchfield = 1:numel(channelFields)
thisFieldName = channelFields{idchfield}; thisFieldName = channelFields{idchfield};
if any(strmatch('split',methods(this.(thisFieldName)),'exact')) % Check if it has a split-function if any(strcmp('split',methods(this.(thisFieldName)))) % Check if it has a split-function
result.(thisFieldName) = split(this.(thisFieldName),index); result.(thisFieldName) = split(this.(thisFieldName),index);
else % just use cat else % just use cat
result.(thisFieldName) = this.(thisFieldName)(index); result.(thisFieldName) = this.(thisFieldName)(index);
...@@ -660,12 +661,12 @@ classdef itaSuper < itaMeta ...@@ -660,12 +661,12 @@ classdef itaSuper < itaMeta
this.data = [this.data this2.data]; this.data = [this.data this2.data];
%% merge channelInfo %% merge channelInfo
channelFields = this.fields; channelFields = properties(this);
channelFields = channelFields(strcmp('channel',channelFields)); channelFields = channelFields(strcmp('channel',channelFields));
for idchfield = 1:numel(channelFields) for idchfield = 1:numel(channelFields)
thisFieldName = channelFields{idchfield}; thisFieldName = channelFields{idchfield};
if any(strmatch('merge',methods(this.(thisFieldName)),'exact')) % Check if it has a merge-function if any(strcmp('merge',methods(this.(thisFieldName)))) % Check if it has a merge-function
this.(thisFieldName) = merge(split(this.(thisFieldName),(1:thischannels)), this2.(thisFieldName)); this.(thisFieldName) = merge(split(this.(thisFieldName),(1:thischannels)), this2.(thisFieldName));
else % just use cat else % just use cat
this.(thisFieldName) = [this.(thisFieldName)(1:thischannels); this2.(thisFieldName)(:)]; this.(thisFieldName) = [this.(thisFieldName)(1:thischannels); this2.(thisFieldName)(:)];
...@@ -859,30 +860,29 @@ classdef itaSuper < itaMeta ...@@ -859,30 +860,29 @@ classdef itaSuper < itaMeta
else else
mode = varargin{1}; mode = varargin{1};
end end
channelNames = this.channelNames; tmp_channelNames = this.channelNames;
channelUnits = this.channelUnits; tmp_channelUnits = this.channelUnits;
channelUnits(strcmpi(channelUnits,'')) = {'1'}; tmp_channelUnits(strcmpi(tmp_channelUnits,'')) = {'1'};
% res = {};
res = cell(1,this.nChannels); 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} = [tmp_channelNames{idx} ' [' tmp_channelUnits{idx} ']' ];
elseif strcmpi(mode,'nothing') elseif strcmpi(mode,'nothing')
res{idx} = [channelNames{idx}]; res{idx} = [tmp_channelNames{idx}];
else 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 end
end end
% TODO What is this supposed to do? % TODO What is this supposed to do?
function res = log_reference(this) % function res = log_reference(this)
%
end % end
function result = get_data(this) function result = get_data(this)
if ~this.mDataTypeEqual || any(this.mDataFactor ~= 1) if ~this.mDataTypeEqual || any(this.mDataFactor ~= 1)
if strmatch('int',this.dataTypeOutput) if strncmp('int', this.dataTypeOutput, 3)
result = cast(this.mData,this.dataTypeOutput); result = cast(this.mData,this.dataTypeOutput);
else else
result = cast(this.mData,this.dataTypeOutput) .* this.mDataFactor; result = cast(this.mData,this.dataTypeOutput) .* this.mDataFactor;
...@@ -895,7 +895,7 @@ classdef itaSuper < itaMeta ...@@ -895,7 +895,7 @@ classdef itaSuper < itaMeta
% this functions is needed for class itaAudioDevNull % this functions is needed for class itaAudioDevNull
% and for the check of even number of samples % and for the check of even number of samples
if ~isa(value, this.dataType) if ~isa(value, this.dataType)
if any(strmatch('int',this.dataType)) && ~any(strmatch('int',this.dataTypeOutput)) if any(strncmp('int', this.dataType, 3)) && ~any(strcmp('int', this.dataTypeOutput, 3))
this.dataFactor = double(max(max(abs(value)))) ./ (double(intmax(this.dataType))-1); this.dataFactor = double(max(max(abs(value)))) ./ (double(intmax(this.dataType))-1);
value = value ./ this.mDataFactor; value = value ./ this.mDataFactor;
end end
...@@ -1011,10 +1011,7 @@ classdef itaSuper < itaMeta ...@@ -1011,10 +1011,7 @@ classdef itaSuper < itaMeta
function displayLineEnd(this) function displayLineEnd(this)
disp(this.LINE_END); disp(this.LINE_END);
end end
function displayEndOfClass(this, classname,firstStr) function displayEndOfClass(this, classname)
% TODO why?
if exist('firstStr','var')
end
classnameString = ['(' classname ')']; classnameString = ['(' classname ')'];
result = repmat(' ', 1, length(this.LINE_START) - length(classnameString)); result = repmat(' ', 1, length(this.LINE_START) - length(classnameString));
disp([result classnameString]); disp([result classnameString]);
...@@ -1068,10 +1065,10 @@ classdef itaSuper < itaMeta ...@@ -1068,10 +1065,10 @@ classdef itaSuper < itaMeta
function dimString = dimString(this) function dimString = dimString(this)
% get a nice dimension string % get a nice dimension string
dimString = []; dimString = [];
dimensions = this.dimensions; tmp_dimensions = this.dimensions;
for ind = 1:numel(dimensions) for ind = 1:numel(tmp_dimensions)
dimString = [dimString num2str(dimensions(ind))]; %#ok<AGROW> dimString = [dimString num2str(tmp_dimensions(ind))]; %#ok<AGROW>
if ind < numel(dimensions) if ind < numel(tmp_dimensions)
dimString = [dimString ' x ']; %#ok<AGROW> dimString = [dimString ' x ']; %#ok<AGROW>
end end
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment