ABS overloads the Absolute value method for Analysis objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: ABS overloads the Absolute value operator for Analysis objects. CALL: ao_out = abs(ao_in); ao_out = abs(ao_in, pl); PARAMETERS: see help for data2D/applymethod for additional parameters M-FILE INFO: Get information about this methods by calling >> ao.getInfo('abs') Get information about a specified set-plist by calling: >> ao.getInfo('abs', 'None') VERSION: $Id: abs.m,v 1.33 2008/09/06 15:23:19 hewitson Exp $ HISTORY: 12-03-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % ABS overloads the Absolute value method for Analysis objects. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: ABS overloads the Absolute value operator for Analysis objects. 0005 % 0006 % CALL: ao_out = abs(ao_in); 0007 % ao_out = abs(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('abs') 0013 % 0014 % Get information about a specified set-plist by calling: 0015 % >> ao.getInfo('abs', 'None') 0016 % 0017 % VERSION: $Id: abs.m,v 1.33 2008/09/06 15:23:19 hewitson Exp $ 0018 % 0019 % HISTORY: 12-03-07 M Hewitson 0020 % Creation 0021 % 0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 0024 function varargout = abs(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 % Get default parameters 0041 pl = combine(pl, getDefaultPlist); 0042 0043 % Decide on a deep copy or a modify 0044 bs = copy(as, nargout); 0045 0046 % Apply method to all AOs 0047 applymethod(bs, ao_invars, 'abs', pl, getDefaultPlist, getInfo); 0048 0049 % Set units 0050 % for ii =1:numel(bs) 0051 % app_axis = pl.find('axis'); 0052 % if ~isempty(find('X'==upper(app_axis), 1)) 0053 % bs(ii).setXunits(feval('abs', bs(ii).data.xunits), 'internal'); 0054 % end 0055 % if ~isempty(find('Y'==upper(app_axis), 1)) 0056 % bs(ii).setYunits(feval('abs', bs(ii).data.yunits), 'internal'); 0057 % end 0058 % end 0059 0060 % Set output 0061 if nargout > 0 0062 varargout{1} = bs; 0063 end 0064 end 0065 0066 %-------------------------------------------------------------------------- 0067 % Get Info Object 0068 %-------------------------------------------------------------------------- 0069 function ii = getInfo(varargin) 0070 if nargin == 1 && strcmpi(varargin{1}, 'None') 0071 sets = {}; 0072 pl = []; 0073 else 0074 sets = {'Default'}; 0075 pl = getDefaultPlist; 0076 end 0077 % Build info object 0078 ii = minfo(mfilename, 'ao', '', utils.const.categories.op, '$Id: abs.m,v 1.33 2008/09/06 15:23:19 hewitson Exp $', sets, pl); 0079 end 0080 0081 %-------------------------------------------------------------------------- 0082 % Get Default Plist 0083 %-------------------------------------------------------------------------- 0084 function pl_default = getDefaultPlist() 0085 0086 pl_default = plist('axis', 'y'); 0087 end 0088