comparison m-toolbox/classes/@ao/imag.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 % IMAG overloads the imaginary operator for analysis objects.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: IMAG overloads the imaginary operator for analysis objects.
5 %
6 % CALL: ao_out = imag(ao_in);
7 % ao_out = imag(ao_in, pl);
8 %
9 % PARAMETERS: see help for data2D/applymethod for additional parameters
10 %
11 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'imag')">Parameters Description</a>
12 %
13 % VERSION: $Id: imag.m,v 1.30 2011/04/19 18:48:11 ingo Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function varargout = imag(varargin)
18
19 % Check if the method was called by another method
20 callerIsMethod = utils.helper.callerIsMethod;
21
22 % Settings
23 operatorName = 'imag';
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
45 end
46
47 %--------------------------------------------------------------------------
48 % Get Info Object
49 %--------------------------------------------------------------------------
50 function ii = getInfo(varargin)
51 ii = minfo.getInfoAxis(mfilename, @getDefaultPlist, varargin);
52 end
53
54 %--------------------------------------------------------------------------
55 % Get Default Plist
56 %--------------------------------------------------------------------------
57
58 function plout = getDefaultPlist(set)
59 persistent pl;
60 persistent lastset;
61 if ~exist('pl', 'var') || isempty(pl) || ~strcmp(lastset, set)
62 pl = buildplist(set);
63 lastset = set;
64 end
65 plout = pl;
66 end
67
68 function plout = buildplist(varargin)
69 plout = plist.getDefaultAxisPlist(varargin{:});
70 end
71