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

bugfix R2017a beta

classObject.fields was undocumented feature, replaced with
properties(classObject)
parent c64cc4d0
......@@ -465,7 +465,7 @@ classdef itaSuper < itaMeta
else
this.mDataTypeEqual = false;
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)
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(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);
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(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));
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 strmatch('int',this.dataTypeOutput)
if strncmp('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(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);
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
......
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