Mercurial > hg > ltpda
comparison m-toolbox/classes/@matrix/iplot.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 % IPLOT calls ao/iplot on all inner ao objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: IPLOT calls ao/iplot on all inner ao objects. | |
5 % | |
6 % CALL: obj = iplot(mat) | |
7 % obj = mat.iplot() | |
8 % | |
9 % Note: if the matrix object does not contain AOs, then an error will be | |
10 % thrown. | |
11 % | |
12 % See the help of ao/iplot for plist options. All options are passed to | |
13 % iplot. | |
14 % | |
15 % <a href="matlab:utils.helper.displayMethodInfo('matrix', 'iplot')">Parameters Description</a> | |
16 % | |
17 % VERSION: $Id: iplot.m,v 1.2 2011/08/12 09:52:15 hewitson Exp $ | |
18 % | |
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
20 | |
21 function varargout = iplot(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 % Collect input variable names | |
30 in_names = cell(size(varargin)); | |
31 for ii = 1:nargin,in_names{ii} = inputname(ii);end | |
32 | |
33 % Collect all matrices and plists | |
34 [as, matrix_invars, rest] = utils.helper.collect_objects(varargin(:), 'matrix', in_names); | |
35 [pl, pl_invars, rest] = utils.helper.collect_objects(varargin(:), 'plist', in_names); | |
36 | |
37 % Decide on a deep copy or a modify | |
38 bs = copy(as, nargout); | |
39 | |
40 % Combine input plists and default plist | |
41 usepl = parse(pl, getDefaultPlist()); | |
42 | |
43 for kk=1:numel(bs) | |
44 m = bs(kk); | |
45 if isa(m.objs, 'ao') | |
46 iplot(m.objs, usepl); | |
47 else | |
48 error('Input matrix %d does not contain AOs.', kk); | |
49 end | |
50 end | |
51 | |
52 end | |
53 | |
54 %-------------------------------------------------------------------------- | |
55 % Get Info Object | |
56 %-------------------------------------------------------------------------- | |
57 function ii = getInfo(varargin) | |
58 | |
59 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
60 sets = {}; | |
61 pl = []; | |
62 else | |
63 sets = {'Default'}; | |
64 pl = getDefaultPlist; | |
65 end | |
66 % Build info object | |
67 ii = minfo(mfilename, 'matrix', 'ltpda', utils.const.categories.output, '$Id: iplot.m,v 1.2 2011/08/12 09:52:15 hewitson Exp $', sets, pl); | |
68 end | |
69 | |
70 %-------------------------------------------------------------------------- | |
71 % Get Default Plist | |
72 %-------------------------------------------------------------------------- | |
73 | |
74 function plout = getDefaultPlist() | |
75 persistent pl; | |
76 if ~exist('pl', 'var') || isempty(pl) | |
77 pl = buildplist(); | |
78 end | |
79 plout = pl; | |
80 end | |
81 | |
82 function pl = buildplist() | |
83 pl = plist.EMPTY_PLIST; | |
84 end | |
85 |