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