


TIMES overloads .* operator for analysis objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: TIMES overloads .* operator for analysis objects.
This just does the same as times (.*) for analysis objects.
CALL: a = a1.*5;
VERSION: $Id: times.m,v 1.13 2008/02/13 18:35:22 hewitson Exp $
The following call returns a parameter list object that contains the
default parameter values:
>> pl = times(ao,'Params')
The following call returns a string that contains the routine CVS version:
>> version = times(ao,'Version')
The following call returns a string that contains the routine category:
>> category = times(ao,'Category')
HISTORY: 05-02-07 M Hewitson
Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 function b = times(varargin) 0002 % TIMES overloads .* operator for analysis objects. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: TIMES overloads .* operator for analysis objects. 0007 % This just does the same as times (.*) for analysis objects. 0008 % 0009 % CALL: a = a1.*5; 0010 % 0011 % VERSION: $Id: times.m,v 1.13 2008/02/13 18:35:22 hewitson Exp $ 0012 % 0013 % The following call returns a parameter list object that contains the 0014 % default parameter values: 0015 % 0016 % >> pl = times(ao,'Params') 0017 % 0018 % The following call returns a string that contains the routine CVS version: 0019 % 0020 % >> version = times(ao,'Version') 0021 % 0022 % The following call returns a string that contains the routine category: 0023 % 0024 % >> category = times(ao,'Category') 0025 % 0026 % HISTORY: 05-02-07 M Hewitson 0027 % Creation 0028 % 0029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0030 0031 ALGONAME = mfilename; 0032 VERSION = '$Id: times.m,v 1.13 2008/02/13 18:35:22 hewitson Exp $'; 0033 CATEGORY = 'Arithmetic Operator'; 0034 0035 % Check if this is a call for parameters 0036 if nargin == 2 0037 if isa(varargin{1}, 'ao') && ischar(varargin{2}) 0038 in = char(varargin{2}); 0039 if strcmp(in, 'Params') 0040 b = getDefaultPL(); 0041 return 0042 elseif strcmp(in, 'Version') 0043 b = VERSION; 0044 return 0045 elseif strcmp(in, 'Category') 0046 b = CATEGORY; 0047 return 0048 end 0049 end 0050 end 0051 0052 % capture input variable names 0053 invars = {}; 0054 for j=1:nargin 0055 iname = inputname(j); 0056 if isempty(iname) && isnumeric(varargin{j}) 0057 iname = num2str(varargin{j}); 0058 elseif isempty(iname) && ischar(varargin{j}) 0059 iname = varargin{j}; 0060 end 0061 invars = [invars cellstr(iname)]; 0062 end 0063 0064 op = '.*'; 0065 0066 [a1,a2,do] = aooperate(varargin, op); 0067 0068 %--------- create output AO 0069 0070 % make a new history object 0071 h = history(ALGONAME, VERSION, plist(), [a1.hist a2.hist]); 0072 h = set(h, 'invars', invars); 0073 0074 % get names for output 0075 if isempty(char(invars{1})) 0076 n1 = a1.name; 0077 else 0078 n1 = char(invars{1}); 0079 end 0080 if isempty(char(invars{2})) 0081 n2 = a2.name; 0082 else 0083 n2 = char(invars{2}); 0084 end 0085 0086 % make output analysis object 0087 % op = op(2:end); 0088 b = ao(do, h); 0089 b = setnh(b, 'name', sprintf('%s %s %s', n1, op, n2)); 0090 0091 0092 % Get default params 0093 function plo = getDefaultPL() 0094 0095 plo = plist(); 0096 0097 0098 % END