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