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