Home > classes > @ao > mean.m

mean

PURPOSE ^

MEAN computes the mean value of the data in the AO.

SYNOPSIS ^

function varargout = mean(varargin)

DESCRIPTION ^

 MEAN computes the mean value of the data in the AO.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: MEAN computes the mean value of the data in the AO.

 CALL:        ao_out = mean(ao_in);
              ao_out = mean(ao_in, pl);

 PARAMETERS:  see help for data2D/applymethod for additional parameters

 M-FILE INFO: Get information about this methods by calling
              >> ao.getInfo('mean')

              Get information about a specified set-plist by calling:
              >> ao.getInfo('mean', 'None')

 VERSION:     $Id: mean.m,v 1.24 2008/09/05 11:15:19 ingo Exp $

 HISTORY:     12-03-07 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % MEAN computes the mean value of the data in the AO.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: MEAN computes the mean value of the data in the AO.
0005 %
0006 % CALL:        ao_out = mean(ao_in);
0007 %              ao_out = mean(ao_in, pl);
0008 %
0009 % PARAMETERS:  see help for data2D/applymethod for additional parameters
0010 %
0011 % M-FILE INFO: Get information about this methods by calling
0012 %              >> ao.getInfo('mean')
0013 %
0014 %              Get information about a specified set-plist by calling:
0015 %              >> ao.getInfo('mean', 'None')
0016 %
0017 % VERSION:     $Id: mean.m,v 1.24 2008/09/05 11:15:19 ingo Exp $
0018 %
0019 % HISTORY:     12-03-07 M Hewitson
0020 %                 Creation
0021 %
0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 
0024 function varargout = mean(varargin)
0025 
0026   % Check if this is a call for parameters
0027   if utils.helper.isinfocall(varargin{:})
0028     varargout{1} = getInfo(varargin{3});
0029     return
0030   end
0031 
0032   % Collect input variable names
0033   in_names = cell(size(varargin));
0034   for ii = 1:nargin,in_names{ii} = inputname(ii);end
0035 
0036   % Collect all AOs
0037   [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names);
0038   pl              = utils.helper.collect_objects(varargin(:), 'plist', in_names);
0039 
0040   % Decide on a deep copy or a modify
0041   bs = copy(as, nargout);
0042 
0043   % Apply method to all AOs
0044   applymethod(bs, ao_invars, 'mean', pl, getDefaultPlist, getInfo);
0045 
0046   % remove fs and nsecs
0047   for j=1:numel(bs)
0048     if ismethod(bs(j).data, 'setFs')
0049       if isprop(bs(j).data, 'nsecs')
0050         bs(j).setFs(1/bs(j).data.nsecs, 'internal');
0051       else
0052         bs(j).setFs(NaN);
0053       end
0054     end
0055   end
0056 
0057   % Set output
0058   if nargout > 0
0059     varargout{1} = bs;
0060   end
0061 end
0062 
0063 %--------------------------------------------------------------------------
0064 % Get Info Object
0065 %--------------------------------------------------------------------------
0066 function ii = getInfo(varargin)
0067   if nargin == 1 && strcmpi(varargin{1}, 'None')
0068     sets = {};
0069     pl   = [];
0070   else
0071     sets = {'Default'};
0072     pl   = getDefaultPlist;
0073   end
0074   % Build info object
0075   ii = minfo(mfilename, 'ao', '', utils.const.categories.op, '$Id: mean.m,v 1.24 2008/09/05 11:15:19 ingo Exp $', sets, pl);
0076 end
0077 
0078 %--------------------------------------------------------------------------
0079 % Get Default Plist
0080 %--------------------------------------------------------------------------
0081 function pl_default = getDefaultPlist()
0082 
0083   pl_default = plist('axis',  'xy');
0084 end
0085 
0086 % END

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003