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