Mercurial > hg > camir-aes2014
comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdata/combine.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function c = combine(varargin) | |
2 | |
3 c = varargin{1}; | |
4 l = length(varargin); | |
5 p = cell(1,l); | |
6 ch = cell(1,l); | |
7 d = cell(1,l); | |
8 fp = cell(1,l); | |
9 sr = cell(1,l); | |
10 n = cell(1,l); | |
11 la = cell(1,l); | |
12 cl = cell(1,l); | |
13 pp = cell(1,l); | |
14 pm = cell(1,l); | |
15 pv = cell(1,l); | |
16 ppp = cell(1,l); | |
17 ppv = cell(1,l); | |
18 tp = cell(1,l); | |
19 tv = cell(1,l); | |
20 tpp = cell(1,l); | |
21 tpv = cell(1,l); | |
22 ap = cell(1,l); | |
23 rp = cell(1,l); | |
24 if isa(c,'temporal') | |
25 nb = cell(1,l); | |
26 end | |
27 if isa(c,'mirscalar') | |
28 m = cell(1,l); | |
29 end | |
30 if isa(c,'miremotion') | |
31 dd = cell(1,l); | |
32 cd = cell(1,l); | |
33 end | |
34 for i = 1:l | |
35 argin = varargin{i}; | |
36 p{i} = getargin(argin,'Pos'); | |
37 ch{i} = getargin(argin,'Channels'); | |
38 d{i} = getargin(argin,'Data'); | |
39 fp{i} = getargin(argin,'FramePos'); | |
40 sr{i} = getargin(argin,'Sampling'); | |
41 nb{i} = getargin(argin,'NBits'); | |
42 n{i} = getargin(argin,'Name'); | |
43 la{i} = getargin(argin,'Label'); | |
44 cl{i} = getargin(argin,'Clusters'); | |
45 pp{i} = getargin(argin,'PeakPos'); | |
46 pm{i} = getargin(argin,'PeakMode'); | |
47 pv{i} = getargin(argin,'PeakVal'); | |
48 ppp{i} = getargin(argin,'PeakPrecisePos'); | |
49 ppv{i} = getargin(argin,'PeakPreciseVal'); | |
50 tp{i} = getargin(argin,'TrackPos'); | |
51 tv{i} = getargin(argin,'TrackVal'); | |
52 tpp{i} = getargin(argin,'TrackPrecisePos'); | |
53 tpv{i} = getargin(argin,'TrackPreciseVal'); | |
54 ap{i} = getargin(argin,'AttackPos'); | |
55 rp{i} = getargin(argin,'ReleasePos'); | |
56 if isa(c,'temporal') | |
57 ct = getargin(argin,'Centered'); | |
58 nb{i} = getargin(argin,'NBits'); | |
59 end | |
60 if isa(c,'mirscalar') | |
61 m{i} = getargin(argin,'Mode'); | |
62 end | |
63 if isa(c,'miremotion') | |
64 dd{i} = getargin(argin,'DimData'); | |
65 cd{i} = getargin(argin,'ClassData'); | |
66 end | |
67 end | |
68 c = set(c,'Pos',p,'Data',d,'FramePos',fp,'Channels',ch,... | |
69 'Sampling',sr,'NBits',nb,'Name',n,'Label',la,... | |
70 'Clusters',cl,'PeakPos',pp,'PeakMode',pm,'PeakVal',pv,... | |
71 'PeakPrecisePos',ppp,'PeakPreciseVal',ppv,... | |
72 'TrackPos',tp,'TrackVal',tv,... | |
73 'TrackPrecisePos',tpp,'TrackPreciseVal',tpv,... | |
74 'AttackPos',ap,'ReleasePos',rp); | |
75 if isa(c,'temporal') | |
76 c = set(c,'Centered',ct,'NBits',nb); | |
77 end | |
78 if isa(c,'mirscalar') | |
79 c = set(c,'Mode',m); | |
80 end | |
81 if isa(c,'miremotion') | |
82 c = set(c,'DimData',dd,'ClassData',cd); | |
83 end | |
84 | |
85 | |
86 function y = getargin(argin,field) | |
87 yi = get(argin,field); | |
88 if isempty(yi) || ischar(yi) | |
89 y = yi; | |
90 else | |
91 y = yi{1}; | |
92 end |