


SIN overloads the sin operator for Analysis objects. Sine of argument in radians.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: SIN overloads the sin operator for Analysis objects.
Sine of argument in radians.
SIN(ao) is the sine of the elements of ao.data.
CALL: ao_out = sin(ao_in);
ao_out = sin(ao_in, pl);
ao_out = sin(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 = sin(ao, 'Params')
HISTORY: 07-05-2007 Diepholz
Creation
SEE: <a href="matlab: help ao/Contents;">HELP: All Analysis Object Functions:</a>
<a href="matlab: helpwin ao/Contents;">DOC: All Analysis Object Functions:</a>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 function ao_out = sin (varargin) 0002 % SIN overloads the sin operator for Analysis objects. Sine of argument in radians. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: SIN overloads the sin operator for Analysis objects. 0007 % Sine of argument in radians. 0008 % SIN(ao) is the sine of the elements of ao.data. 0009 % 0010 % CALL: ao_out = sin(ao_in); 0011 % ao_out = sin(ao_in, pl); 0012 % ao_out = sin(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 = sin(ao, 'Params') 0027 % 0028 % HISTORY: 07-05-2007 Diepholz 0029 % Creation 0030 % 0031 % SEE: <a href="matlab: help ao/Contents;">HELP: All Analysis Object Functions:</a> 0032 % <a href="matlab: helpwin ao/Contents;">DOC: All Analysis Object Functions:</a> 0033 % 0034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0035 0036 ALGONAME = mfilename; 0037 VERSION = '$Id: sin.m,v 1.11 2007/06/22 08:32:49 ingo Exp $'; 0038 ao_out = []; 0039 pl = []; 0040 option = ''; 0041 0042 %% Check if this is a call for parameters 0043 if nargin == 2 0044 if isa(varargin{1}, 'ao') && ischar(varargin{2}) 0045 in = char(varargin{2}); 0046 if strcmp(in, 'Params') 0047 ao_out = getDefaultPL(); 0048 return 0049 end 0050 end 0051 end 0052 0053 %% store the input ao's in the vector: ao_set 0054 ao_set = []; 0055 for i=1:nargin 0056 a = varargin{i}; 0057 if isa(a, 'ao') 0058 0059 a = reshape(a, 1, []); 0060 ao_set = [ao_set a]; 0061 0062 elseif isa(varargin{i}, 'plist') 0063 pl = [pl varargin{i}]; 0064 end 0065 end 0066 0067 if ~isempty (pl) 0068 pl = combine(pl); 0069 end 0070 0071 %% go through analysis objects 0072 for j=1:length(ao_set) 0073 a = ao_set(j); 0074 0075 [h, sin_data] = single_operation(a.data, 'sin', pl); 0076 0077 %% Add the history from the ao object to the history 0078 h = set(h, 'inhists', [a.hist]); 0079 0080 %% Set the var_name to the history 0081 if (j <= nargin) 0082 if (isempty (inputname(j))) 0083 h = set(h, 'invars', cellstr('no var_name')); 0084 else 0085 h = set(h, 'invars', cellstr(inputname(j))); 0086 end 0087 else 0088 h = set(h, 'invars', cellstr('no var_name')); 0089 end 0090 0091 %% create a new analysis objects 0092 new_ao = a; 0093 new_ao = ao (sin_data, h); 0094 new_ao = set (new_ao, 'name', sprintf('sin(%s)',a.name) ); 0095 0096 ao_out = [ao_out new_ao]; 0097 0098 end 0099 0100 %% Get default params 0101 function pl_default = getDefaultPL() 0102 0103 disp('* creating default plist...'); 0104 pl_default = plist([param('xdata', '') 0105 param('ydata', '')]); 0106 disp('* done.'); 0107 0108 0109 % END