comparison m-toolbox/test/new_plot/collect_inputs.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function [aos, pls, invars] = collect_inputs(varargin, in_names)
2 % COLLECT_INPUTS Collect the AOs and Plists.
3 %
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 %
6 % DESCRIPTION: COLLECT_INPUTS Collect the AOs and Plists.
7 %
8 % CALL: [aos, pls, invars] = collect_inputs(varargin, in_names);
9 %
10 % INPUTS: varargin: A list of analysis objects (ao's) and
11 % parameter lists (plist's)
12 % in_names: Corresponding variable names of the contents in
13 % varargin
14 %
15 % OUTPUTS: aos: Collection of all analysis objects
16 % pls: Collection of parameter lists
17 % invars: Collection of the ao names of the corresponding ao.
18 %
19 % VERSION: $Id: collect_inputs.m,v 1.1 2007/12/24 19:51:00 hewitson Exp $
20 %
21 % HISTORY: 08-05-07 Diepholz
22 % Creation
23 %
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
26
27 % dd1 = dbstack
28 % dd2 = dbstatus
29
30 aos = [];
31 invars = {};
32 pls = plist();
33
34 %% collect input ao's, plist's and ao variable names
35
36 for j=1:numel(varargin)
37
38 if isa(varargin{j}, 'ao')
39 aos = [aos varargin{j}];
40
41 ao_name = in_names{j};
42 if isempty(ao_name)
43 ao_name = 'no_ao_name';
44 end
45
46 % Memorise the variable name of the corresponding analysis object.
47 % If the ao is an array or vector add the index to the variable name
48 if numel(varargin{j}) == 1
49 invars{end+1} = ao_name;
50 else
51 for ii=1:numel(varargin{j})
52 [I,J] = ind2sub(size(varargin{j}),ii);
53 invars{end+1} = sprintf('%s(%d,%d)', ao_name, I, J);
54 end
55 end
56 end
57 if isa(varargin{j}, 'plist')
58 pls = [pls varargin{j}];
59 end
60 end