IMAG overloads the imaginary operator for Analysis objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: IMAG overloads the imaginary operator for Analysis objects. CALL: ao = imag(ao_in); ao = imag(ao_in, pl); PARAMETERS: see help for data2D/applymethod for additional parameters M-FILE INFO: Get information about this methods by calling >> ao.getInfo('imag') Get information about a specified set-plist by calling: >> ao.getInfo('imag', 'None') VERSION: $Id: imag.m,v 1.12 2008/09/05 11:15:19 ingo Exp $ HISTORY: 20-0802007 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % IMAG overloads the imaginary operator for Analysis objects. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: IMAG overloads the imaginary operator for Analysis objects. 0005 % 0006 % CALL: ao = imag(ao_in); 0007 % ao = imag(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('imag') 0013 % 0014 % Get information about a specified set-plist by calling: 0015 % >> ao.getInfo('imag', 'None') 0016 % 0017 % VERSION: $Id: imag.m,v 1.12 2008/09/05 11:15:19 ingo Exp $ 0018 % 0019 % HISTORY: 20-0802007 Diepholz 0020 % Creation 0021 % 0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 0024 function varargout = imag(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 import utils.const.* 0033 utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename); 0034 0035 % Collect input variable names 0036 in_names = cell(size(varargin)); 0037 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0038 0039 % Collect all AOs and plists 0040 [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0041 [pl, pl_invars] = utils.helper.collect_objects(varargin(:), 'plist', in_names); 0042 0043 % Decide on a deep copy or a modify 0044 bs = copy(as, nargout); 0045 0046 % Combine plists 0047 pl = combine(pl, getDefaultPlist); 0048 0049 % Apply method to all AOs 0050 applymethod(bs, ao_invars, 'imag', pl, getDefaultPlist, getInfo); 0051 0052 % Reshape the ouput to the same size of the input 0053 if nargout > 0 0054 varargout{1} = bs; 0055 end 0056 0057 end 0058 %-------------------------------------------------------------------------- 0059 % Get Info Object 0060 %-------------------------------------------------------------------------- 0061 function ii = getInfo(varargin) 0062 if nargin == 1 && strcmpi(varargin{1}, 'None') 0063 sets = {}; 0064 pl = []; 0065 else 0066 sets = {'Default'}; 0067 pl = getDefaultPlist; 0068 end 0069 % Build info object 0070 ii = minfo(mfilename, 'ao', '', utils.const.categories.op, '$Id: imag.m,v 1.12 2008/09/05 11:15:19 ingo Exp $', sets, pl); 0071 end 0072 0073 %-------------------------------------------------------------------------- 0074 % Get Default Plist 0075 %-------------------------------------------------------------------------- 0076 function pl_default = getDefaultPlist() 0077 pl_default = plist('axis', 'y'); 0078 end 0079