Home > classes > @cdata > setYunits.m

setYunits

PURPOSE ^

SETYUNITS Set the property 'yunits'.

SYNOPSIS ^

function varargout = setYunits(varargin)

DESCRIPTION ^

 SETYUNITS Set the property 'yunits'.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: Set the property 'yunits'.

 CALL:              obj.setYunits('my units');
              obj = obj.setYunits('my units'); create copy of the object

 INPUTS:      obj - must be a single cdata 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.4 2008/09/05 14:16:30 hewitson Exp $

 HISTORY:     27-05-2008 Diepholz
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003