SETYUNITS Set the property 'yunits'. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Set the property 'yunits'. CALL: obj.setYunits('units'); obj = obj.setYunits('units'); create copy of the object INPUTS: obj - must be a single data2D object. units - unit object or a valid string which can be transform into a unit object. M-FILE INFO: Get information about this methods by calling >> fsdata.getInfo('setYunits') Get information about a specified set-plist by calling: >> fsdata.getInfo('setYunits', 'None') VERSION: $Id: setYunits.m,v 1.6 2008/09/05 14:16:30 hewitson Exp $ HISTORY: 27-05-2008 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % SETYUNITS Set the property 'yunits'. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: Set the property 'yunits'. 0005 % 0006 % CALL: obj.setYunits('units'); 0007 % obj = obj.setYunits('units'); create copy of the object 0008 % 0009 % INPUTS: obj - must be a single data2D object. 0010 % units - unit object or a valid string which can be transform 0011 % into a unit object. 0012 % 0013 % M-FILE INFO: Get information about this methods by calling 0014 % >> fsdata.getInfo('setYunits') 0015 % 0016 % Get information about a specified set-plist by calling: 0017 % >> fsdata.getInfo('setYunits', 'None') 0018 % 0019 % VERSION: $Id: setYunits.m,v 1.6 2008/09/05 14:16:30 hewitson Exp $ 0020 % 0021 % HISTORY: 27-05-2008 Diepholz 0022 % Creation 0023 % 0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0025 0026 function varargout = setYunits(varargin) 0027 0028 %%% Check if this is a call for parameters 0029 if utils.helper.isinfocall(varargin{:}) 0030 varargout{1} = getInfo(varargin{3}); 0031 return 0032 end 0033 0034 obj = varargin{1}; 0035 val = varargin{2}; 0036 0037 %%% decide whether we modify the pz-object, or create a new one. 0038 obj = copy(obj, nargout); 0039 0040 %%% set 'yunits' 0041 if ischar(val) 0042 obj.yunits = unit(val); 0043 elseif iscell(val) 0044 obj.yunits = val{1}; 0045 else 0046 obj.yunits = val; 0047 end 0048 0049 varargout{1} = obj; 0050 end 0051 0052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0053 % Local Functions % 0054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0055 0056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0057 % 0058 % FUNCTION: getInfo 0059 % 0060 % DESCRIPTION: Get Info Object 0061 % 0062 % HISTORY: 11-07-07 M Hewitson 0063 % Creation. 0064 % 0065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0066 0067 function ii = getInfo(varargin) 0068 if nargin == 1 && strcmpi(varargin{1}, 'None') 0069 sets = {}; 0070 pl = []; 0071 else 0072 sets = {'Default'}; 0073 pl = getDefaultPlist; 0074 end 0075 % Build info object 0076 ii = minfo(mfilename, 'data2D', '', utils.const.categories.internal, '$Id: setYunits.m,v 1.6 2008/09/05 14:16:30 hewitson Exp $', sets, pl); 0077 end 0078 0079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0080 % 0081 % FUNCTION: getDefaultPlist 0082 % 0083 % DESCRIPTION: Get Default Plist 0084 % 0085 % HISTORY: 11-07-07 M Hewitson 0086 % Creation. 0087 % 0088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0089 0090 function plo = getDefaultPlist() 0091 plo = plist('yunits', unit); 0092 end 0093