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') 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 % HISTORY: 23-05-2007 Diepholz 0029 % Creation 0030 % 0031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0032 0033 VERSION = '$Id: ln.m,v 1.6 2007/10/31 17:03:45 ingo Exp $'; 0034 ao_out = []; 0035 pl = []; 0036 0037 %% Check if this is a call for parameters 0038 if nargin == 2 0039 if isa(varargin{1}, 'ao') && ischar(varargin{2}) 0040 in = char(varargin{2}); 0041 if strcmp(in, 'Params') 0042 ao_out = getDefaultPL(); 0043 return 0044 elseif strcmp(in, 'Version') 0045 ao_out = VERSION; 0046 return 0047 end 0048 end 0049 end 0050 0051 %% store the input ao's in the vector: ao_set 0052 ao_set = []; 0053 for i=1:nargin 0054 a = varargin{i}; 0055 if isa(a, 'ao') 0056 ao_set = [ao_set a]; 0057 elseif isa(varargin{i}, 'plist') 0058 pl = [pl varargin{i}]; 0059 end 0060 end 0061 0062 ao_out = log(ao_set, pl); 0063 0064 %% Get default params 0065 function pl_default = getDefaultPL() 0066 0067 pl_default = plist([param('xdata', '') 0068 param('ydata', '')]); 0069 0070 % END