Home > classes > @cdata > cdata.m

cdata

PURPOSE ^

CDATA is the constant data class.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 CDATA is the constant data class.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: CDATA is the constant data class.

 SUPER CLASSES: ltpda_data

 SUB CLASSES:

 PROPERTIES:

     Protected Properties (read only)
       yunits  - units of the y-axis
       y       - a matrix of data samples

 CDATA METHODS:

     Defined Abstract methods:
       char          - returns one character string which represents the object
       copy          - copies an object
       display       - displays an object
       update_struct - updates a object structure to the current tbx-version

     Public Methods
       setYunits     - set the property 'yunits'
       setY          - set the property 'y'
       getY          - get the property 'y'
       applymethod   - applys the given method to the input 2D data
       applyoperator - applys the given operator to the two input data objects

 M-FILE INFO:  The following call returns an minfo object that contains
               information about the cdata constructor:
                    >> info = cdata.getInfo
               or   >> info = cdata.getInfo('cdata')

               You can get information about class methods by calling:
                    >> info = cdata.getInfo(method)
               e.g. >> info = cdata.getInfo('eq')

               You can also restrict the sets of parameters contained in
               the minfo object by calling:
                    >> info = cdata.getInfo(method, set)
               e.g. >> info = cdata.getInfo('cdata', 'Default')

 VERSION:  $Id: cdata.m,v 1.47 2008/09/07 18:11:30 hewitson Exp $

 HISTORY:  09-06-2008 Hewitson
              Creation.

 SEE ALSO: ltpda_obj, ao, miir, mfir, specwin, timespan, pzmodel, history, ssm

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % CDATA is the constant data class.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: CDATA is the constant data class.
0005 %
0006 % SUPER CLASSES: ltpda_data
0007 %
0008 % SUB CLASSES:
0009 %
0010 % PROPERTIES:
0011 %
0012 %     Protected Properties (read only)
0013 %       yunits  - units of the y-axis
0014 %       y       - a matrix of data samples
0015 %
0016 % CDATA METHODS:
0017 %
0018 %     Defined Abstract methods:
0019 %       char          - returns one character string which represents the object
0020 %       copy          - copies an object
0021 %       display       - displays an object
0022 %       update_struct - updates a object structure to the current tbx-version
0023 %
0024 %     Public Methods
0025 %       setYunits     - set the property 'yunits'
0026 %       setY          - set the property 'y'
0027 %       getY          - get the property 'y'
0028 %       applymethod   - applys the given method to the input 2D data
0029 %       applyoperator - applys the given operator to the two input data objects
0030 %
0031 % M-FILE INFO:  The following call returns an minfo object that contains
0032 %               information about the cdata constructor:
0033 %                    >> info = cdata.getInfo
0034 %               or   >> info = cdata.getInfo('cdata')
0035 %
0036 %               You can get information about class methods by calling:
0037 %                    >> info = cdata.getInfo(method)
0038 %               e.g. >> info = cdata.getInfo('eq')
0039 %
0040 %               You can also restrict the sets of parameters contained in
0041 %               the minfo object by calling:
0042 %                    >> info = cdata.getInfo(method, set)
0043 %               e.g. >> info = cdata.getInfo('cdata', 'Default')
0044 %
0045 % VERSION:  $Id: cdata.m,v 1.47 2008/09/07 18:11:30 hewitson Exp $
0046 %
0047 % HISTORY:  09-06-2008 Hewitson
0048 %              Creation.
0049 %
0050 % SEE ALSO: ltpda_obj, ao, miir, mfir, specwin, timespan, pzmodel, history, ssm
0051 %
0052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0053 
0054 classdef cdata < ltpda_data
0055 
0056 
0057   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0058   %                            Property definition                            %
0059   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0060 
0061   %---------- Public (read/write) Properties  ----------
0062   properties
0063   end
0064 
0065   %---------- Protected read-only Properties ----------
0066   properties (SetAccess = protected)
0067     yunits  = unit;
0068     y       = [];
0069     version = '$Id: cdata.m,v 1.47 2008/09/07 18:11:30 hewitson Exp $';
0070   end
0071 
0072   %---------- Private Properties ----------
0073   properties (GetAccess = protected, SetAccess = protected)
0074   end
0075 
0076   %---------- Abstract Properties ----------
0077   properties (Abstract = true, SetAccess = protected)
0078   end
0079 
0080   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0081   %                          Check property setting                           %
0082   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0083 
0084   methods
0085     function obj = set.yunits(obj, val)
0086       if ischar(val)
0087         obj.yunits = unit(val);
0088       elseif isa(val, 'unit')
0089         obj.yunits = val;
0090       else
0091         error('### The yunits value must be a unit or a string');
0092       end
0093     end
0094     function obj = set.y(obj, val)
0095       if ~isnumeric(val) || ndims(val) ~= 2
0096         error('### The value for the property ''y'' must be a numeric matrix');
0097       end
0098       obj.y = val;
0099     end
0100   end
0101 
0102   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0103   %                                Constructor                                %
0104   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0105 
0106   methods
0107     function obj = cdata(varargin)
0108 
0109       %%% Call superclass
0110       obj = obj@ltpda_data(varargin{:});
0111 
0112       %%%%%%%%%%   Set dafault values   %%%%%%%%%%
0113 
0114       if nargin == 0
0115         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0116         %%%%%%%%%%%%%%%%%%%%%%%%%%%%   no inputs   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0117         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0118 
0119       elseif nargin == 1
0120         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0121         %%%%%%%%%%%%%%%%%%%%%%%%%%%%   one input   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0122         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0123 
0124         if isa(varargin{1}, 'cdata')
0125           %%%%%%%%%%   Copy ltpda_obj Object        %%%%%%%%%%
0126           %%%%%%%%%%   data = cdata(cdata-object)   %%%%%%%%%%
0127           obj = copy(varargin{1}, 1);
0128 
0129         elseif isstruct(varargin{1})
0130           %%%%%%%%%%   data = cdata(struct)   %%%%%%%%%%
0131           %%% Set properties which are declared in this class
0132           obj.yunits  = unit(varargin{1}.yunits);
0133           obj.y       = varargin{1}.y;
0134           obj.version = varargin{1}.version;
0135 
0136         elseif isnumeric(varargin{1})
0137           %%%%%%%%%%   data = cdata(data- vector, matrix)   %%%%%%%%%%
0138           obj = obj.setY(varargin{1});
0139         else
0140           error('### Unknown single argument constructor.');
0141         end
0142 
0143       else
0144         error('### Unknown number of arguments.');
0145       end
0146 
0147     end % End constructor
0148 
0149   end
0150 
0151   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0152   %                              Methods (public)                             %
0153   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0154 
0155   methods
0156     varargout = char(varargin)
0157     varargout = copy(varargin)
0158     
0159     varargout = setYunits(varargin)
0160     varargout = setY(varargin)
0161     varargout = getY(varargin)
0162   end
0163 
0164   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0165   %                              Methods (protected)                          %
0166   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0167 
0168   methods (Access = protected)
0169 
0170   end
0171 
0172   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0173   %                              Methods (public)                             %
0174   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0175 
0176   methods
0177   end
0178 
0179   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0180   %                              Methods (static)                             %
0181   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0182 
0183   methods (Static)
0184     varargout = update_struct(varargin);
0185 
0186     function out = VEROUT()
0187       out = '$Id: cdata.m,v 1.47 2008/09/07 18:11:30 hewitson Exp $';
0188     end
0189 
0190     function ii = getInfo(varargin)
0191       ii = utils.helper.generic_getInfo(varargin{:}, 'cdata');
0192     end
0193 
0194     function out = SETS()
0195       out = {'Default'};
0196     end
0197 
0198     function out = getDefaultPlist(set)
0199       switch set
0200         case 'Default'
0201           out = plist();
0202         otherwise
0203           error('### Unknown set [%s]', set');
0204       end
0205     end
0206 
0207   end
0208 
0209   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0210   %                              Methods (abstract)                           %
0211   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0212 
0213   methods (Abstract)
0214   end
0215 
0216 end
0217

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