Mercurial > hg > ltpda
comparison m-toolbox/classes/@ao/tan.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 % TAN overloads the tan method for analysis objects. | |
2 % | |
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
4 % | |
5 % DESCRIPTION: TAN overloads the tan operator for analysis objects. | |
6 % | |
7 % CALL: ao_out = tan(ao_in); | |
8 % ao_out = tan(ao_in, pl); | |
9 % ao_out = tan(ao1, pl1, ao_vector, ao_matrix, pl2); | |
10 % | |
11 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'tan')">Parameters Description</a> | |
12 % | |
13 % VERSION: $Id: tan.m,v 1.34 2011/04/19 18:48:11 ingo Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 | |
17 function varargout = tan(varargin) | |
18 | |
19 % Check if the method was called by another method | |
20 callerIsMethod = utils.helper.callerIsMethod; | |
21 | |
22 % Settings | |
23 operatorName = 'tan'; | |
24 dxFcn = @(x,dx)abs(1./(cos(x)).^2).*dx; | |
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 |