LN overloads the log operator for Analysis objects. Natural logarithm. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: LN overloads the log operator for Analysis objects. Natural logarithm. LN(ao) is the natural logarithm of the elements of ao.data. CALL: ao_out = ln(ao_in); ao_out = ln(ao_in, pl); ao_out = ln(ao1, pl1, ao_vector, ao_matrix, pl2); POSSIBLE VALUES: ao_in = [ao2 ao3] ao_in = ao_vector ao_in = ao_matrix PARAMETER LIST: <key> <value> <description> tsdata fsdata xydata 'xdata' 't' 'f' 'x' compute the xdata 'ydata' 'x' 'xx' 'y' compute the ydata The following call returns a parameter list object that contains the default parameter values: >> pl = ln(ao, 'Params') The following call returns a string that contains the routine CVS version: >> version = ln(ao,'Version') The following call returns a string that contains the routine category: >> category = ln(ao,'Category') HISTORY: 23-05-2007 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function ao_out = ln (varargin) 0002 % LN overloads the log operator for Analysis objects. Natural logarithm. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: LN overloads the log operator for Analysis objects. 0007 % Natural logarithm. 0008 % LN(ao) is the natural logarithm of the elements of ao.data. 0009 % 0010 % CALL: ao_out = ln(ao_in); 0011 % ao_out = ln(ao_in, pl); 0012 % ao_out = ln(ao1, pl1, ao_vector, ao_matrix, pl2); 0013 % 0014 % POSSIBLE VALUES: ao_in = [ao2 ao3] 0015 % ao_in = ao_vector 0016 % ao_in = ao_matrix 0017 % 0018 % PARAMETER LIST: <key> <value> <description> 0019 % tsdata fsdata xydata 0020 % 'xdata' 't' 'f' 'x' compute the xdata 0021 % 'ydata' 'x' 'xx' 'y' compute the ydata 0022 % 0023 % The following call returns a parameter list object that contains the 0024 % default parameter values: 0025 % 0026 % >> pl = ln(ao, 'Params') 0027 % 0028 % The following call returns a string that contains the routine CVS version: 0029 % 0030 % >> version = ln(ao,'Version') 0031 % 0032 % The following call returns a string that contains the routine category: 0033 % 0034 % >> category = ln(ao,'Category') 0035 % 0036 % HISTORY: 23-05-2007 Diepholz 0037 % Creation 0038 % 0039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0040 0041 VERSION = '$Id: ln.m,v 1.7 2008/02/12 09:29:24 mauro Exp $'; 0042 CATEGORY = 'Operator'; 0043 0044 ao_out = []; 0045 pl = []; 0046 0047 %% Check if this is a call for parameters 0048 if nargin == 2 0049 if isa(varargin{1}, 'ao') && ischar(varargin{2}) 0050 in = char(varargin{2}); 0051 if strcmp(in, 'Params') 0052 ao_out = getDefaultPL(); 0053 return 0054 elseif strcmp(in, 'Version') 0055 ao_out = VERSION; 0056 return 0057 elseif strcmp(in, 'Category') 0058 ao_out = CATEGORY; 0059 return 0060 end 0061 end 0062 end 0063 0064 %% store the input ao's in the vector: ao_set 0065 ao_set = []; 0066 for i=1:nargin 0067 a = varargin{i}; 0068 if isa(a, 'ao') 0069 ao_set = [ao_set a]; 0070 elseif isa(varargin{i}, 'plist') 0071 pl = [pl varargin{i}]; 0072 end 0073 end 0074 0075 ao_out = log(ao_set, pl); 0076 0077 %% Get default params 0078 function pl_default = getDefaultPL() 0079 0080 pl_default = plist([param('xdata', '') 0081 param('ydata', '')]); 0082 0083 % END