Mercurial > hg > ltpda
comparison m-toolbox/classes/@ao/y.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 % Y Get the data property 'y'. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: Get the data property 'y'. | |
5 % | |
6 % CALL: val = y(a1,a2,a3,...) | |
7 % val = y(as) | |
8 % val = as.y() | |
9 % | |
10 % INPUTS: aN - input analysis objects | |
11 % as - input analysis objects array | |
12 % | |
13 % OUTPUTS: val - matrix with 'y', one column for each input object | |
14 % | |
15 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'y')">Parameters Description</a> | |
16 % | |
17 % VERSION: $Id: y.m,v 1.16 2011/04/19 17:05:45 ingo Exp $ | |
18 % | |
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
20 | |
21 function varargout = y(varargin) | |
22 | |
23 % Check if this is a call for parameters | |
24 if utils.helper.isinfocall(varargin{:}) | |
25 varargout{1} = getInfo(varargin{3}); | |
26 return | |
27 end | |
28 | |
29 % Check if the method was called by another method | |
30 callerIsMethod = utils.helper.callerIsMethod; | |
31 | |
32 if ~callerIsMethod | |
33 % Collect all AOs | |
34 [as, dummy, rest] = utils.helper.collect_objects(varargin(:), 'ao'); | |
35 | |
36 % Collect numeric and char arguments to pass to getY | |
37 args = {}; | |
38 for kk = 1:numel(rest) | |
39 if isnumeric(rest{kk}) || ischar(rest{kk}) || islogical(rest{kk}) | |
40 args = [args {rest{kk}}]; | |
41 end | |
42 end | |
43 else | |
44 % Assume the input is a single AO or a vector of AOs | |
45 as = varargin{1}; | |
46 | |
47 % Collect numeric and char arguments to pass to getY | |
48 args = {}; | |
49 for kk = 2:nargin | |
50 if isnumeric(varargin{kk}) || ischar(varargin{kk}) || islogical(varargin{kk}) | |
51 args = [args {varargin{kk}}]; | |
52 end | |
53 end | |
54 end | |
55 | |
56 % Get property | |
57 out = []; | |
58 for jj = 1:numel(as) | |
59 out = [out as(jj).data.getY(args{:})]; | |
60 end | |
61 | |
62 % Set output | |
63 varargout{1} = out; | |
64 | |
65 end | |
66 | |
67 %-------------------------------------------------------------------------- | |
68 % Get Info Object | |
69 %-------------------------------------------------------------------------- | |
70 function ii = getInfo(varargin) | |
71 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
72 sets = {}; | |
73 pl = []; | |
74 else | |
75 sets = {'Default'}; | |
76 pl = getDefaultPlist; | |
77 end | |
78 % Build info object | |
79 ii = minfo(mfilename, 'ao', 'ltpda', utils.const.categories.helper, '$Id: y.m,v 1.16 2011/04/19 17:05:45 ingo Exp $', sets, pl); | |
80 ii.setModifier(false); | |
81 end | |
82 | |
83 %-------------------------------------------------------------------------- | |
84 % Get Default Plist | |
85 %-------------------------------------------------------------------------- | |
86 function plout = getDefaultPlist() | |
87 persistent pl; | |
88 if ~exist('pl', 'var') || isempty(pl) | |
89 pl = buildplist(); | |
90 end | |
91 plout = pl; | |
92 end | |
93 | |
94 function pl = buildplist() | |
95 pl = plist.EMPTY_PLIST; | |
96 end |