RDIVIDE overloads ./ operator for analysis objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: RDIVIDE overloads ./ operator for analysis objects. CALL: a = a1./scalar VERSION: $Id: rdivide.html,v 1.14 2008/03/31 10:27:32 hewitson Exp $ The following call returns a parameter list object that contains the default parameter values: >> pl = rdivide(ao, 'Params') The following call returns a string that contains the routine CVS version: >> version = rdivide(ao,'Version') The following call returns a string that contains the routine category: >> category = rdivide(ao,'Category') HISTORY: 05-02-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % RDIVIDE overloads ./ operator for analysis objects. 0002 % 0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0004 % 0005 % DESCRIPTION: RDIVIDE overloads ./ operator for analysis objects. 0006 % 0007 % CALL: a = a1./scalar 0008 % 0009 % VERSION: $Id: rdivide.html,v 1.14 2008/03/31 10:27:32 hewitson Exp $ 0010 % 0011 % The following call returns a parameter list object that contains the 0012 % default parameter values: 0013 % 0014 % >> pl = rdivide(ao, 'Params') 0015 % 0016 % The following call returns a string that contains the routine CVS version: 0017 % 0018 % >> version = rdivide(ao,'Version') 0019 % 0020 % The following call returns a string that contains the routine category: 0021 % 0022 % >> category = rdivide(ao,'Category') 0023 % 0024 % HISTORY: 05-02-07 M Hewitson 0025 % Creation 0026 % 0027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0028 0029 function b = rdivide(varargin) 0030 0031 ALGONAME = mfilename; 0032 VERSION = '$Id: rdivide.html,v 1.14 2008/03/31 10:27:32 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 % Collect input ao's, plist's and ao variable names 0053 in_names = {}; 0054 for ii = 1:nargin 0055 in_names{end+1} = inputname(ii); 0056 end 0057 0058 [as, pl, invars] = collect_inputs(varargin, in_names); 0059 0060 op = './'; 0061 0062 [a1,a2,do] = aooperate(varargin, op); 0063 0064 %--------- create output AO 0065 0066 % make a new history object 0067 h = history(ALGONAME, VERSION, plist(), [a1.hist a2.hist]); 0068 h = set(h, 'invars', invars); 0069 0070 % get names for output 0071 if isempty(char(invars{1})) 0072 n1 = a1.name; 0073 else 0074 n1 = char(invars{1}); 0075 end 0076 if isempty(char(invars{2})) 0077 n2 = a2.name; 0078 else 0079 n2 = char(invars{2}); 0080 end 0081 0082 % make output analysis object 0083 b = ao(do, h); 0084 b = setnh(b, 'name', sprintf('%s %s %s', n1, op, n2)); 0085 0086 0087 %% Get default params 0088 function pl_default = getDefaultPL() 0089 0090 pl_default = plist(); 0091 0092 % END