COS overloads the cos operator for Analysis objects. Cosine of argument in radians. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: COS overloads the cos operator for Analysis objects. Cosine of argument in radians. COS(ao) is the cosine of the elements of ao.data. CALL: ao_out = cos(ao_in); ao_out = cos(ao_in, pl); ao_out = cos(ao1, pl1, ao_vector, ao_matrix, pl2); POSSIBLE VALUES: ao_in = [ao2 ao3] ao_in = ao_vector ao_in = ao_matrix PARAMETERS: see help for data2D/applymethod for additional parameters M-FILE INFO: Get information about this methods by calling >> ao.getInfo('cos') Get information about a specified set-plist by calling: >> ao.getInfo('cos', 'None') HISTORY: 07-05-2007 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % COS overloads the cos operator for Analysis objects. Cosine of argument in radians. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: COS overloads the cos operator for Analysis objects. 0005 % Cosine of argument in radians. 0006 % COS(ao) is the cosine of the elements of ao.data. 0007 % 0008 % CALL: ao_out = cos(ao_in); 0009 % ao_out = cos(ao_in, pl); 0010 % ao_out = cos(ao1, pl1, ao_vector, ao_matrix, pl2); 0011 % 0012 % POSSIBLE VALUES: ao_in = [ao2 ao3] 0013 % ao_in = ao_vector 0014 % ao_in = ao_matrix 0015 % 0016 % PARAMETERS: see help for data2D/applymethod for additional parameters 0017 % 0018 % M-FILE INFO: Get information about this methods by calling 0019 % >> ao.getInfo('cos') 0020 % 0021 % Get information about a specified set-plist by calling: 0022 % >> ao.getInfo('cos', 'None') 0023 % 0024 % HISTORY: 07-05-2007 Diepholz 0025 % Creation 0026 % 0027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0028 0029 function varargout = cos (varargin) 0030 0031 % Check if this is a call for parameters 0032 if utils.helper.isinfocall(varargin{:}) 0033 varargout{1} = getInfo(varargin{3}); 0034 return 0035 end 0036 0037 % Collect input variable names 0038 in_names = cell(size(varargin)); 0039 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0040 0041 % Collect all AOs 0042 [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0043 pl = utils.helper.collect_objects(varargin(:), 'plist', in_names); 0044 0045 % Decide on a deep copy or a modify 0046 bs = copy(as, nargout); 0047 0048 % Combine plists 0049 pl = combine(pl, getDefaultPlist); 0050 0051 % Apply method to all AOs 0052 applymethod(bs, ao_invars, 'cos', pl, getDefaultPlist, getInfo); 0053 0054 % Reshape the ouput to the same size of the input 0055 if nargout > 0 0056 varargout{1} = bs; 0057 end 0058 end 0059 0060 %-------------------------------------------------------------------------- 0061 % Get Info Object 0062 %-------------------------------------------------------------------------- 0063 function ii = getInfo(varargin) 0064 0065 if nargin == 1 && strcmpi(varargin{1}, 'None') 0066 sets = {}; 0067 pl = []; 0068 else 0069 sets = {'Default'}; 0070 pl = getDefaultPlist; 0071 end 0072 % Build info object 0073 ii = minfo(mfilename, 'ao', '', utils.const.categories.trig, '$Id: cos.m,v 1.15 2008/09/05 11:05:28 ingo Exp $', sets, pl); 0074 end 0075 0076 %-------------------------------------------------------------------------- 0077 % Get Default Plist 0078 %-------------------------------------------------------------------------- 0079 function pl_default = getDefaultPlist() 0080 pl_default = plist('axis', 'y'); 0081 end 0082 0083