Home > classes > @ao > tan.m

tan

PURPOSE ^

TAN overloads the tan operator for Analysis objects. Tangent of argument in radians.

SYNOPSIS ^

function ao_out = tan (varargin)

DESCRIPTION ^

 TAN overloads the tan operator for Analysis objects. Tangent of argument in radians.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: TAN overloads the tan operator for Analysis objects.
              Tangent of argument in radians.
              TAN(ao) is the tangent of the elements of ao.data.

 CALL: ao_out = tan(ao_in);
       ao_out = tan(ao_in, pl);
       ao_out = tan(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

 HISTORY: 07-05-2007 Diepholz
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ao_out = tan (varargin)
0002 % TAN overloads the tan operator for Analysis objects. Tangent of argument in radians.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: TAN overloads the tan operator for Analysis objects.
0007 %              Tangent of argument in radians.
0008 %              TAN(ao) is the tangent of the elements of ao.data.
0009 %
0010 % CALL: ao_out = tan(ao_in);
0011 %       ao_out = tan(ao_in, pl);
0012 %       ao_out = tan(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 % HISTORY: 07-05-2007 Diepholz
0024 %             Creation
0025 %
0026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0027 
0028 ALGONAME = mfilename;
0029 VERSION  = '$Id: tan.html,v 1.1 2007/06/08 14:15:03 hewitson Exp $';
0030 ao_out   = [];
0031 pl       = [];
0032 option   = '';
0033 
0034 %% store the input ao's in the vector: ao_set
0035 ao_set = [];
0036 for i=1:nargin
0037   a = varargin{i};
0038   if isa(a, 'ao')
0039     [m,n] = size(a);
0040     for i = 1:m
0041       for j = 1:n
0042         ao_set  = [ao_set a(i,j)];
0043       end
0044     end
0045   elseif isa(varargin{i}, 'plist')
0046     pl = [pl varargin{i}];
0047   end
0048 end
0049 
0050 if ~isempty (pl)
0051   pl = combine(pl);
0052 end
0053 
0054 %% go through analysis objects
0055 for j=1:length(ao_set)
0056   a = ao_set(j);
0057 
0058   [h, tan_data] = single_operation(a.data, 'tan', pl);
0059 
0060   %% Add the history from the ao object to the history
0061   h = set(h, 'inhists', [a.hist]);
0062 
0063   %% Set the var_name to the history
0064   if (j <= nargin)
0065     if (isempty (inputname(j)))
0066       h = set(h, 'invars', cellstr('no var_name'));
0067     else
0068       h = set(h, 'invars', cellstr(inputname(j)));
0069     end
0070   else
0071     h = set(h, 'invars', cellstr('no var_name'));
0072   end
0073 
0074   %% create a new analysis objects
0075   new_ao = a;
0076   new_ao = ao  (tan_data, h);
0077   new_ao = set (new_ao, 'name', sprintf('tan(%s)',a.name) );
0078 
0079   ao_out = [ao_out new_ao];
0080 
0081 end
0082 
0083 % END

Generated on Fri 08-Jun-2007 16:09:11 by m2html © 2003