comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdata/mpower.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 = mpower(a,b)
2
3 d = get(a,'Data');
4 f = cell(1,length(d));
5 n = get(a,'Name');
6 t = get(a,'Title');
7 if not(isa(a,'miraudio'))
8 if isa(b,'mirdata')
9 t = [t,' ^ ',get(b,'Title')];
10 else
11 t = [t,' ^ ',num2str(b)];
12 end
13 end
14
15 if isa(b,'mirdata')
16 e = get(b,'Data');
17 m = get(b,'Name');
18 else
19 e = {{b}};
20 m = {num2str(b)};
21 end
22
23 for i = 1:length(d)
24 f{i} = cell(1,length(d{i}));
25 for j = 1:length(d{i})
26 ld = size(d{i}{j},1);
27 le = size(e{i}{j},1);
28 if ld > le
29 f{i}{j} = d{i}{j} .^ [e{i}{j};zeros(ld-le,size(e,2),size(e,3))];
30 else
31 f{i}{j} = [d{i}{j};zeros(le-ld,size(d,2),size(d,3))] .^ e{i}{j};
32 end
33 end
34 if isa(a,'miraudio')
35 n{i} = [n{i} '^' m{i}];
36 end
37 end
38 c = set(a,'Data',f,'Name',n,'Title',t);