annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdata/mtimes.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 = mtimes(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 = cell(1,length(d));
wolffd@0 20 for i = 1:length(d)
wolffd@0 21 e{i} = {b};
wolffd@0 22 end
wolffd@0 23 m = {num2str(b)};
wolffd@0 24 end
wolffd@0 25
wolffd@0 26 for i = 1:length(d)
wolffd@0 27 f{i} = cell(1,length(d{i}));
wolffd@0 28 for j = 1:length(d{i})
wolffd@0 29 ld = size(d{i}{j},1);
wolffd@0 30 le = size(e{i}{j},1);
wolffd@0 31 if ld > le
wolffd@0 32 f{i}{j} = d{i}{j} .* [e{i}{j};zeros(ld-le,size(e,2),size(e,3))];
wolffd@0 33 elseif ld < le
wolffd@0 34 f{i}{j} = [d{i}{j};zeros(le-ld,size(d,2),size(d,3))] .* e{i}{j};
wolffd@0 35 else
wolffd@0 36 f{i}{j} = d{i}{j} .* e{i}{j};
wolffd@0 37 end
wolffd@0 38 end
wolffd@0 39 if isa(a,'miraudio')
wolffd@0 40 n{i} = [n{i} '*' m{i}];
wolffd@0 41 end
wolffd@0 42 end
wolffd@0 43 c = set(a,'Data',f,'Name',n,'Title',t);