Home > classes > @xydata > xydata.m

xydata

PURPOSE ^

XYDATA X-Y data object class constructor.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 XYDATA X-Y data object class constructor.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: XYDATA X-Y data object class constructor.
              Create an X-Y data object.

 SUPER CLASSES: data2D < ltpda_data < ltpda_nuo < ltpda_obj

 PROPERTIES:

     Inherit Properties (read only)
       version - cvs-version string
       xunits  - units of the y-axis
       yunits  - units of the y-axis
       x       - data values of the x-axis
       y       - data values of the y-axis

     Properties (read only)

     Possible constructors:
       xy = xydata()      - creates a blank xy-data object
       xy = xydata(y)     - creates an xy data object with the given
                            y-data.
       xy = xydata(x,y)   - creates an xy-data object with the given
                            (x,y)-data.

 XYDATA 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

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

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

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

 VERSION:  $Id: xydata.m,v 1.30 2008/08/22 14:14:14 ingo Exp $

 HISTORY:  30-01-2007 Hewitson
              Creation

 SEE ALSO: tsdata, fsdata, xydata, cdata, data2D, data3D, xyzdata

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % XYDATA X-Y data object class constructor.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: XYDATA X-Y data object class constructor.
0005 %              Create an X-Y data object.
0006 %
0007 % SUPER CLASSES: data2D < ltpda_data < ltpda_nuo < ltpda_obj
0008 %
0009 % PROPERTIES:
0010 %
0011 %     Inherit Properties (read only)
0012 %       version - cvs-version string
0013 %       xunits  - units of the y-axis
0014 %       yunits  - units of the y-axis
0015 %       x       - data values of the x-axis
0016 %       y       - data values of the y-axis
0017 %
0018 %     Properties (read only)
0019 %
0020 %     Possible constructors:
0021 %       xy = xydata()      - creates a blank xy-data object
0022 %       xy = xydata(y)     - creates an xy data object with the given
0023 %                            y-data.
0024 %       xy = xydata(x,y)   - creates an xy-data object with the given
0025 %                            (x,y)-data.
0026 %
0027 % XYDATA METHODS:
0028 %
0029 %     Defined Abstract methods:
0030 %       char          - returns one character string which represents the object
0031 %       copy          - copies an object
0032 %       display       - displays an object
0033 %       update_struct - updates a object structure to the current tbx-version
0034 %
0035 % M-FILE INFO:  The following call returns an minfo object that contains
0036 %               information about the xydata constructor:
0037 %                    >> info = xydata.getInfo
0038 %               or   >> info = xydata.getInfo('xydata')
0039 %
0040 %               You can get information about class methods by calling:
0041 %                    >> info = xydata.getInfo(method)
0042 %               e.g. >> info = xydata.getInfo('eq')
0043 %
0044 %               You can also restrict the sets of parameters contained in
0045 %               the minfo object by calling:
0046 %                    >> info = xydata.getInfo(method, set)
0047 %               e.g. >> info = xydata.getInfo('xydata', 'Default')
0048 %
0049 % VERSION:  $Id: xydata.m,v 1.30 2008/08/22 14:14:14 ingo Exp $
0050 %
0051 % HISTORY:  30-01-2007 Hewitson
0052 %              Creation
0053 %
0054 % SEE ALSO: tsdata, fsdata, xydata, cdata, data2D, data3D, xyzdata
0055 %
0056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0057 
0058 classdef xydata < data2D
0059 
0060   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0061   %                            Property definition                            %
0062   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0063 
0064   %---------- Public (read/write) Properties  ----------
0065   properties
0066   end
0067 
0068   %---------- Protected read-only Properties ----------
0069   properties (SetAccess = protected)
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   end
0086 
0087   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0088   %                                Constructor                                %
0089   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0090 
0091   methods
0092     function obj = xydata(varargin)
0093 
0094       % Call data2D constructor since we add no special features here.
0095       obj = obj@data2D(varargin{:});
0096 
0097       %%%%%%%%%%   Set dafault values   %%%%%%%%%%
0098       %%% Exept for a struct as an input
0099       if ~(nargin == 1 && isstruct(varargin{1}))
0100         % set version
0101         obj.setVersion('$Id: xydata.m,v 1.30 2008/08/22 14:14:14 ingo Exp $');
0102       end
0103 
0104       if nargin == 0
0105         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0106         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%   no input   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0107         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0108 
0109       elseif nargin == 1
0110         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0111         %%%%%%%%%%%%%%%%%%%%%%%%%%%%   one input   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0112         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0113 
0114         if isa(varargin{1}, 'xydata')
0115           %%%%%%%%%%  obj = xydata(xydata-object)   %%%%%%%%%%
0116           obj = copy(varargin{1}, 1);
0117 
0118         elseif isnumeric(varargin{1})
0119           %%%%%%%%%%  obj = xydata(y-vector)   %%%%%%%%%%
0120           obj.setY(varargin{1});
0121 
0122         elseif isstruct(varargin{1})
0123           %%%%%%%%%%   data = xydata(struct)   %%%%%%%%%%
0124           %%% Do nothing because all values are set in the super class
0125 
0126         else
0127           error('### Unknown single argument constructor.');
0128         end
0129 
0130       elseif nargin == 2
0131         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0132         %%%%%%%%%%%%%%%%%%%%%%%%%%%%   one input   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0133         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0134 
0135         %%%%%%%%%%  obj = xydata(x-vector, y-vector)   %%%%%%%%%%
0136         if numel(varargin{1}) == numel(varargin{2})
0137           obj.setXY(varargin{1}, varargin{2});
0138         end
0139 
0140       else
0141         error('### Unknown two argument constructor.');
0142       end
0143     end % End constructor
0144   end
0145 
0146   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0147   %                              Methods (public)                             %
0148   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0149 
0150   methods
0151   end
0152 
0153   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0154   %                              Methods (public)                             %
0155   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0156 
0157   methods
0158     varargout = display(varargin);
0159     varargout = copy(varargin)
0160   end
0161 
0162   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0163   %                              Methods (protected)                          %
0164   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0165 
0166   methods (Access = protected)
0167   end
0168 
0169   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0170   %                              Methods (static)                             %
0171   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0172 
0173   methods (Static)
0174     varargout = update_struct(varargin);
0175 
0176     function out = VEROUT()
0177       out = '$Id: xydata.m,v 1.30 2008/08/22 14:14:14 ingo Exp $';
0178     end
0179 
0180     function ii = getInfo(varargin)
0181       ii = utils.helper.generic_getInfo(varargin{:}, 'xydata');
0182     end
0183 
0184     function out = SETS()
0185       out = {'Default'};
0186     end
0187 
0188     function out = getDefaultPlist(set)
0189       switch set
0190         case 'Default'
0191           out = plist();
0192         otherwise
0193           error('### Unknown set [%s]', set');
0194       end
0195     end
0196 
0197   end
0198 
0199   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0200   %                              Methods (abstract)                           %
0201   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0202 
0203   methods (Abstract)
0204   end
0205 
0206 end
0207

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003