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