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