Mercurial > hg > ltpda
comparison m-toolbox/classes/@ao/real.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 % REAL overloads the real operator for analysis objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: REAL overloads the real operator for analysis objects. | |
5 % | |
6 % CALL: ao_out = real(ao_in); | |
7 % ao_out = real(ao_in, pl); | |
8 % | |
9 % PARAMETERS: see help for data2D/applymethod for additional parameters | |
10 % | |
11 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'real')">Parameters Description</a> | |
12 % | |
13 % VERSION: $Id: real.m,v 1.28 2011/04/19 18:48:11 ingo Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 | |
17 function varargout = real(varargin) | |
18 | |
19 % Check if the method was called by another method | |
20 callerIsMethod = utils.helper.callerIsMethod; | |
21 | |
22 % Settings | |
23 operatorName = 'real'; | |
24 dxFcn = []; | |
25 | |
26 if callerIsMethod | |
27 in_names = {}; | |
28 else | |
29 % Collect input variable names | |
30 in_names = cell(size(varargin)); | |
31 for ii = 1:nargin,in_names{ii} = inputname(ii);end | |
32 end | |
33 | |
34 copyObjects = nargout>0; | |
35 [bs, pl] = ao.applymethod(copyObjects, callerIsMethod, in_names, operatorName, dxFcn, @getInfo, @getDefaultPlist, varargin{:}); | |
36 | |
37 if isa(bs, 'ao') | |
38 % Set units | |
39 setUnitsForAxis(bs, pl, ''); | |
40 end | |
41 | |
42 % set outputs | |
43 varargout = utils.helper.setoutputs(nargout, bs); | |
44 end | |
45 | |
46 %-------------------------------------------------------------------------- | |
47 % Get Info Object | |
48 %-------------------------------------------------------------------------- | |
49 function ii = getInfo(varargin) | |
50 ii = minfo.getInfoAxis(mfilename, @getDefaultPlist, varargin); | |
51 end | |
52 | |
53 %-------------------------------------------------------------------------- | |
54 % Get Default Plist | |
55 %-------------------------------------------------------------------------- | |
56 | |
57 function plout = getDefaultPlist(set) | |
58 persistent pl; | |
59 persistent lastset; | |
60 if ~exist('pl', 'var') || isempty(pl) || ~strcmp(lastset, set) | |
61 pl = buildplist(set); | |
62 lastset = set; | |
63 end | |
64 plout = pl; | |
65 end | |
66 | |
67 function plout = buildplist(varargin) | |
68 plout = plist.getDefaultAxisPlist(varargin{:}); | |
69 end | |
70 |