Home > classes > @ao > power.m

power

PURPOSE ^

POWER implements power operator for analysis objects.

SYNOPSIS ^

function varargout = power(varargin)

DESCRIPTION ^

 POWER implements power operator for analysis objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: POWER implements power operator for analysis objects.

 CALL:        a = a1.^scalar
              a = a1.^a2

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

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

 VERSION:     $Id: power.m,v 1.22 2008/09/05 11:05:29 ingo Exp $

 HISTORY:     01-02-07 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % POWER implements power operator for analysis objects.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: POWER implements power operator for analysis objects.
0005 %
0006 % CALL:        a = a1.^scalar
0007 %              a = a1.^a2
0008 %
0009 % M-FILE INFO: Get information about this methods by calling
0010 %              >> ao.getInfo('power')
0011 %
0012 %              Get information about a specified set-plist by calling:
0013 %              >> ao.getInfo('power', 'None')
0014 %
0015 % VERSION:     $Id: power.m,v 1.22 2008/09/05 11:05:29 ingo Exp $
0016 %
0017 % HISTORY:     01-02-07 M Hewitson
0018 %                 Creation
0019 %
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 
0022 function varargout = power(varargin)
0023 
0024   import utils.const.*
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   utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename);
0033 
0034   % Collect input ao's, plist's and ao variable names
0035   in_names = cell(size(varargin));
0036   for ii = 1:nargin,in_names{ii} = inputname(ii);end
0037 
0038   % Check for numbers in the other arguments and convert to AOs
0039   args = utils.helper.collect_values(varargin);
0040   [as, ao_invars] = utils.helper.collect_objects(args, 'ao', in_names);
0041   pl              = utils.helper.collect_objects(args, 'plist');
0042 
0043   % Combine with default plist
0044   pl = combine(pl, getDefaultPlist);
0045 
0046   % Decide on a deep copy or a modify
0047   bs = copy(as, nargout);
0048 
0049   % Set output
0050   varargout{1} = applyoperator(bs, ao_invars, 'power', '.^', pl, getInfo);
0051 end
0052 
0053 %--------------------------------------------------------------------------
0054 % Get Info Object
0055 %--------------------------------------------------------------------------
0056 function ii = getInfo(varargin)
0057   if nargin == 1 && strcmpi(varargin{1}, 'None')
0058     sets = {};
0059     pl   = [];
0060   else
0061     sets = {'Default'};
0062     pl   = getDefaultPlist;
0063   end
0064   % Build info object
0065   ii = minfo(mfilename, 'ao', '', utils.const.categories.aop, '$Id: power.m,v 1.22 2008/09/05 11:05:29 ingo Exp $', sets, pl);
0066 end
0067 
0068 %--------------------------------------------------------------------------
0069 % Get Default Plist
0070 %--------------------------------------------------------------------------
0071 function pl_default = getDefaultPlist()
0072   pl_default = plist();
0073 end
0074 
0075 % END
0076

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