Mercurial > hg > camir-aes2014
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function c = mtimes(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 = cell(1,length(d)); | |
20 for i = 1:length(d) | |
21 e{i} = {b}; | |
22 end | |
23 m = {num2str(b)}; | |
24 end | |
25 | |
26 for i = 1:length(d) | |
27 f{i} = cell(1,length(d{i})); | |
28 for j = 1:length(d{i}) | |
29 ld = size(d{i}{j},1); | |
30 le = size(e{i}{j},1); | |
31 if ld > le | |
32 f{i}{j} = d{i}{j} .* [e{i}{j};zeros(ld-le,size(e,2),size(e,3))]; | |
33 elseif ld < le | |
34 f{i}{j} = [d{i}{j};zeros(le-ld,size(d,2),size(d,3))] .* e{i}{j}; | |
35 else | |
36 f{i}{j} = d{i}{j} .* e{i}{j}; | |
37 end | |
38 end | |
39 if isa(a,'miraudio') | |
40 n{i} = [n{i} '*' m{i}]; | |
41 end | |
42 end | |
43 c = set(a,'Data',f,'Name',n,'Title',t); |