comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/mircompute.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 varargout = mircompute(algo,varargin)
2
3 l = length(varargin{1}); % number of audio files.
4 for i = 1:l
5 % for each audio file
6 v = varargin;
7 for j = 1:length(v)
8 % for each variable associated to that audio
9 if isa(v{j},'mirdata')
10 v{j} = get(v{j},'Data');
11 end
12 if iscell(v{j})
13 v{j} = v{j}{i};
14 end
15 %if not(iscell(v{j}))
16 % v{j} = {v{j}};
17 %end
18 end
19 % final result for that audio
20 for k = 1:length(v{1})
21 % for each segment in that audio file
22 vk = v;
23 for j = 1:length(vk)
24 if iscell(vk{j})
25 vk{j} = vk{j}{k};
26 end
27 end
28 if 1 %nargout == 1
29 res = algo(vk{:});
30 else %% used for miremotion, provokes bug else...
31 [res res2 res3 res4] = algo(vk{:});
32 end
33 if iscell(res)
34 lr = length(res);
35 for j = 1:lr
36 varargout{j}{i}{k} = res{j};
37 end
38 else
39 varargout{1}{i}{k} = res;
40 if nargout == 4
41 varargout{2}{i}{k} = res2;
42 varargout{3}{i}{k} = res3;
43 varargout{4}{i}{k} = res4;
44 end
45 end
46 end
47 end