Home > classes > @xyzdata > xyzdata.m

xyzdata

PURPOSE ^

XZYDATA X-Y-Z data object class constructor.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 XZYDATA X-Y-Z data object class constructor.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

 SUPER CLASSES: data3D < 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
       zunits  - units of the z-axis
       x       - data values of the x-axis
       y       - data values of the y-axis
       z       - data values of the z-axis

     Possible constructors:
       xyz = xyzdata()      - creates a blank xyz object
       xyz = xyzdata(z)     - creates an xyz object with the given
                              z-data.
       xyz = xydata(x,y,z)  - creates an xyz object with the given
                              (x,y,z)-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 xyzdata constructor:
                    >> info = xyzdata.getInfo
               or   >> info = xyzdata.getInfo('xyzdata')

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

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

 VERSION:  $Id: xyzdata.m,v 1.12 2008/09/03 16:39:37 hewitson 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 % XZYDATA X-Y-Z data object class constructor.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: XZYDATA X-Y-Z data object class constructor.
0005 %              Create an X-Y-Z data object.
0006 %
0007 % SUPER CLASSES: data3D < 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 %       zunits  - units of the z-axis
0016 %       x       - data values of the x-axis
0017 %       y       - data values of the y-axis
0018 %       z       - data values of the z-axis
0019 %
0020 %     Possible constructors:
0021 %       xyz = xyzdata()      - creates a blank xyz object
0022 %       xyz = xyzdata(z)     - creates an xyz object with the given
0023 %                              z-data.
0024 %       xyz = xydata(x,y,z)  - creates an xyz object with the given
0025 %                              (x,y,z)-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 xyzdata constructor:
0037 %                    >> info = xyzdata.getInfo
0038 %               or   >> info = xyzdata.getInfo('xyzdata')
0039 %
0040 %               You can get information about class methods by calling:
0041 %                    >> info = xyzdata.getInfo(method)
0042 %               e.g. >> info = xyzdata.getInfo('eq')
0043 %
0044 %               You can also restrict the sets of parameters contained in
0045 %               the minfo object by calling:
0046 %                    >> info = xyzdata.getInfo(method, set)
0047 %               e.g. >> info = xyzdata.getInfo('xyzdata', 'Default')
0048 %
0049 % VERSION:  $Id: xyzdata.m,v 1.12 2008/09/03 16:39:37 hewitson 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 xyzdata < data3D
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     version = '$Id: xyzdata.m,v 1.12 2008/09/03 16:39:37 hewitson Exp $';
0071   end
0072 
0073   %---------- Private Properties ----------
0074   properties (GetAccess = protected, SetAccess = protected)
0075   end
0076 
0077   %---------- Abstract Properties ----------
0078   properties (Abstract = true, SetAccess = protected)
0079   end
0080 
0081   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0082   %                          Check property setting                           %
0083   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0084 
0085   methods
0086   end
0087 
0088   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0089   %                                Constructor                                %
0090   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0091 
0092   methods
0093     function obj = xyzdata(varargin)
0094 
0095       % Call data2D constructor since we add no special features here.
0096       obj = obj@data3D(varargin{:});
0097 
0098       %%%%%%%%%%   Set dafault values   %%%%%%%%%%
0099 
0100       if nargin == 0
0101         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0102         %%%%%%%%%%%%%%%%%%%%%%%%%%%%   no inputs   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0103         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0104 
0105       elseif nargin == 1
0106         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0107         %%%%%%%%%%%%%%%%%%%%%%%%%%%%   one input   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0108         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0109 
0110         if isa(varargin{1}, 'xyzdata')
0111           %%%%%%%%%%   xy = xydata(xydata)   %%%%%%%%%%
0112           obj = copy(varargin{1}, 1);
0113 
0114         elseif isstruct(varargin{1})
0115           %%%%%%%%%%   data = xyzdata(struct)   %%%%%%%%%%
0116           obj.version = varargin{1}.version;
0117           
0118           %%% Do nothing. Because no properties are defined in this class.
0119 
0120         elseif isnumeric(varargin{1}) && length(varargin{1}) > 1
0121           %%%%%%%%%%   xyz = xyzdata(z_vector)   %%%%%%%%%%
0122           obj.x = 1:size(varargin{1}, 1);
0123           obj.y = 1:size(varargin{1}, 2);
0124           obj.z = varargin{1};
0125 
0126         elseif isa(varargin{1}, 'plist')
0127           %%%%%%%%%%  ts = xydata(plist)   %%%%%%%%%%
0128           if nparams(varargin{1}) == 0
0129             % return empty object
0130           else
0131             error('### Unknown xyzdata constructor method.');
0132           end
0133 
0134         else
0135           error('### Unknown xyzdata constructor method with one argument.');
0136         end
0137 
0138       elseif nargin == 3
0139         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0140         %%%%%%%%%%%%%%%%%%%%%%%%%%%   three input   %%%%%%%%%%%%%%%%%%%%%%%%%%%
0141         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0142 
0143         obj.x = varargin{1};
0144         obj.y = varargin{2};
0145         obj.z = varargin{3};
0146       else
0147         error('### Unknown number of constructor arguments.');
0148       end
0149 
0150       %%%%%%%%%%   Normalize the the x- and y-vector   %%%%%%%%%%
0151 
0152       nx = size(obj.z, 2);
0153       ny = size(obj.z, 1);
0154 
0155       if length(obj.x) ~= nx
0156         error('### X-vector has wrong length.');
0157       end
0158       if length(obj.y) ~= ny
0159         error('### Y-vector has wrong length.');
0160       end
0161 
0162     end % End constructor
0163   end
0164 
0165   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0166   %                              Methods (public)                             %
0167   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0168 
0169   methods
0170     varargout = copy(varargin)
0171   end
0172 
0173   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0174   %                              Methods (protected)                          %
0175   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0176 
0177   methods (Access = protected)
0178   end
0179 
0180   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0181   %                              Methods (public)                             %
0182   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0183 
0184   methods
0185     varargout = display(varargin);
0186   end
0187 
0188   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0189   %                              Methods (static)                             %
0190   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0191 
0192   methods (Static)
0193     varargout = update_struct(varargin);
0194 
0195     function out = VEROUT()
0196       out = '$Id: xyzdata.m,v 1.12 2008/09/03 16:39:37 hewitson Exp $';
0197     end
0198 
0199     function ii = getInfo(varargin)
0200       ii = utils.helper.generic_getInfo(varargin{:}, 'xyzdata');
0201     end
0202 
0203     function out = SETS()
0204       out = {'Default'};
0205     end
0206 
0207     function out = getDefaultPlist(set)
0208       switch set
0209         case 'Default'
0210           out = plist();
0211         otherwise
0212           error('### Unknown set [%s]', set');
0213       end
0214     end
0215 
0216   end
0217 
0218   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0219   %                              Methods (abstract)                           %
0220   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0221 
0222   methods (Abstract)
0223   end
0224 
0225 end
0226

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