Daniel@0: function c = combine(varargin) Daniel@0: Daniel@0: c = varargin{1}; Daniel@0: l = length(varargin); Daniel@0: p = cell(1,l); Daniel@0: ch = cell(1,l); Daniel@0: d = cell(1,l); Daniel@0: fp = cell(1,l); Daniel@0: sr = cell(1,l); Daniel@0: n = cell(1,l); Daniel@0: la = cell(1,l); Daniel@0: cl = cell(1,l); Daniel@0: pp = cell(1,l); Daniel@0: pm = cell(1,l); Daniel@0: pv = cell(1,l); Daniel@0: ppp = cell(1,l); Daniel@0: ppv = cell(1,l); Daniel@0: tp = cell(1,l); Daniel@0: tv = cell(1,l); Daniel@0: tpp = cell(1,l); Daniel@0: tpv = cell(1,l); Daniel@0: ap = cell(1,l); Daniel@0: rp = cell(1,l); Daniel@0: if isa(c,'temporal') Daniel@0: nb = cell(1,l); Daniel@0: end Daniel@0: if isa(c,'mirscalar') Daniel@0: m = cell(1,l); Daniel@0: end Daniel@0: if isa(c,'miremotion') Daniel@0: dd = cell(1,l); Daniel@0: cd = cell(1,l); Daniel@0: end Daniel@0: for i = 1:l Daniel@0: argin = varargin{i}; Daniel@0: p{i} = getargin(argin,'Pos'); Daniel@0: ch{i} = getargin(argin,'Channels'); Daniel@0: d{i} = getargin(argin,'Data'); Daniel@0: fp{i} = getargin(argin,'FramePos'); Daniel@0: sr{i} = getargin(argin,'Sampling'); Daniel@0: nb{i} = getargin(argin,'NBits'); Daniel@0: n{i} = getargin(argin,'Name'); Daniel@0: la{i} = getargin(argin,'Label'); Daniel@0: cl{i} = getargin(argin,'Clusters'); Daniel@0: pp{i} = getargin(argin,'PeakPos'); Daniel@0: pm{i} = getargin(argin,'PeakMode'); Daniel@0: pv{i} = getargin(argin,'PeakVal'); Daniel@0: ppp{i} = getargin(argin,'PeakPrecisePos'); Daniel@0: ppv{i} = getargin(argin,'PeakPreciseVal'); Daniel@0: tp{i} = getargin(argin,'TrackPos'); Daniel@0: tv{i} = getargin(argin,'TrackVal'); Daniel@0: tpp{i} = getargin(argin,'TrackPrecisePos'); Daniel@0: tpv{i} = getargin(argin,'TrackPreciseVal'); Daniel@0: ap{i} = getargin(argin,'AttackPos'); Daniel@0: rp{i} = getargin(argin,'ReleasePos'); Daniel@0: if isa(c,'temporal') Daniel@0: ct = getargin(argin,'Centered'); Daniel@0: nb{i} = getargin(argin,'NBits'); Daniel@0: end Daniel@0: if isa(c,'mirscalar') Daniel@0: m{i} = getargin(argin,'Mode'); Daniel@0: end Daniel@0: if isa(c,'miremotion') Daniel@0: dd{i} = getargin(argin,'DimData'); Daniel@0: cd{i} = getargin(argin,'ClassData'); Daniel@0: end Daniel@0: end Daniel@0: c = set(c,'Pos',p,'Data',d,'FramePos',fp,'Channels',ch,... Daniel@0: 'Sampling',sr,'NBits',nb,'Name',n,'Label',la,... Daniel@0: 'Clusters',cl,'PeakPos',pp,'PeakMode',pm,'PeakVal',pv,... Daniel@0: 'PeakPrecisePos',ppp,'PeakPreciseVal',ppv,... Daniel@0: 'TrackPos',tp,'TrackVal',tv,... Daniel@0: 'TrackPrecisePos',tpp,'TrackPreciseVal',tpv,... Daniel@0: 'AttackPos',ap,'ReleasePos',rp); Daniel@0: if isa(c,'temporal') Daniel@0: c = set(c,'Centered',ct,'NBits',nb); Daniel@0: end Daniel@0: if isa(c,'mirscalar') Daniel@0: c = set(c,'Mode',m); Daniel@0: end Daniel@0: if isa(c,'miremotion') Daniel@0: c = set(c,'DimData',dd,'ClassData',cd); Daniel@0: end Daniel@0: Daniel@0: Daniel@0: function y = getargin(argin,field) Daniel@0: yi = get(argin,field); Daniel@0: if isempty(yi) || ischar(yi) Daniel@0: y = yi; Daniel@0: else Daniel@0: y = yi{1}; Daniel@0: end