


DATA2D is the abstract base class for 2-dimensional data objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: DATA2D is the base class for 2-dimensional data objects. This is
an abstract class.
SUPER CLASSES: ltpda_data < ltpda_nuo < ltpda_obj
SUB CLASSES: xydata, tsdata, fsdata, data3D
PROPERTIES:
Inherit Properties (read only)
version - cvs-version string.
Protected Properties (read only)
xunits - units of the x-axis
yunits - units of the y-axis
x - data values of the x-axis
y - data values of the y-axis
DATA2D METHODS:
Public Methods
char - returns one character string which represents the object
setXunits - set the property 'xunits'
setYunits - set the property 'yunits'
setX - set the property 'x'
setY - set the property 'y'
setXY - set the property 'x' and 'y'
getX - get the property 'x'
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
VERSION: $Id: data2D.m,v 1.17 2008/08/25 11:15:53 ingo Exp $
HISTORY: 09-06-2008 Hewitson
Creation.
SEE ALSO: ltpda_data, fsdata, tsdata, xydata, data3D
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 % DATA2D is the abstract base class for 2-dimensional data objects. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: DATA2D is the base class for 2-dimensional data objects. This is 0005 % an abstract class. 0006 % 0007 % SUPER CLASSES: ltpda_data < ltpda_nuo < ltpda_obj 0008 % 0009 % SUB CLASSES: xydata, tsdata, fsdata, data3D 0010 % 0011 % PROPERTIES: 0012 % 0013 % Inherit Properties (read only) 0014 % version - cvs-version string. 0015 % 0016 % Protected Properties (read only) 0017 % xunits - units of the x-axis 0018 % yunits - units of the y-axis 0019 % x - data values of the x-axis 0020 % y - data values of the y-axis 0021 % 0022 % DATA2D METHODS: 0023 % 0024 % Public Methods 0025 % char - returns one character string which represents the object 0026 % setXunits - set the property 'xunits' 0027 % setYunits - set the property 'yunits' 0028 % setX - set the property 'x' 0029 % setY - set the property 'y' 0030 % setXY - set the property 'x' and 'y' 0031 % getX - get the property 'x' 0032 % getY - get the property 'y' 0033 % applymethod - applys the given method to the input 2D data 0034 % applyoperator - applys the given operator to the two input data objects 0035 % 0036 % VERSION: $Id: data2D.m,v 1.17 2008/08/25 11:15:53 ingo Exp $ 0037 % 0038 % HISTORY: 09-06-2008 Hewitson 0039 % Creation. 0040 % 0041 % SEE ALSO: ltpda_data, fsdata, tsdata, xydata, data3D 0042 % 0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0044 0045 classdef data2D < ltpda_data 0046 0047 0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0049 % Property definition % 0050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0051 0052 %---------- Public (read/write) Properties ---------- 0053 properties 0054 end 0055 0056 %---------- Protected read-only Properties ---------- 0057 properties 0058 xunits = sym('empty'); 0059 yunits = sym('empty'); 0060 x = []; 0061 y = []; 0062 end 0063 0064 %---------- Private Properties ---------- 0065 properties (GetAccess = protected, SetAccess = protected) 0066 end 0067 0068 %---------- Abstract Properties ---------- 0069 properties (Abstract = true, SetAccess = protected) 0070 end 0071 0072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0073 % Check property setting % 0074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0075 0076 methods 0077 %--- Xunits 0078 function obj = set.xunits(obj, val) 0079 if ~ischar(val) && ~isa(val, 'sym') 0080 error('### The value for the property ''xunits'' must be a symbolic-object'); 0081 end 0082 if ischar(val) 0083 obj.xunits = sym(val); 0084 else 0085 obj.xunits = val; 0086 end 0087 obj.xunits = simplify(obj.xunits); 0088 end 0089 %--- Yunits 0090 function obj = set.yunits(obj, val) 0091 if ~ischar(val) && ~isa(val, 'sym') 0092 error('### The value for the property ''yunits'' must be a symbolic-object'); 0093 end 0094 if ischar(val) 0095 obj.yunits = sym(val); 0096 else 0097 obj.yunits = val; 0098 end 0099 obj.yunits = simplify(obj.yunits); 0100 end 0101 %--- X 0102 function obj = set.x(obj, val) 0103 if ~isempty(val) 0104 if ~isnumeric(val) || ~isvector(val) 0105 error('### The value for the property ''x'' must be a numeric vector'); 0106 end 0107 end 0108 obj.x = val; 0109 0110 sx = size(obj.x); 0111 sy = size(obj.y); 0112 if sx(1) == 1 && sy(1) ~= 1 0113 obj.x = obj.x.'; 0114 end 0115 if sx(2) == 1 && sy(2) ~= 1 0116 obj.x = obj.x.'; 0117 end 0118 0119 end 0120 %--- Y 0121 function obj = set.y(obj, val) 0122 if ~isempty(val) 0123 if ~isnumeric(val) || ~isvector(val) 0124 error('### The value for the property ''y'' must be a numeric vector'); 0125 end 0126 end 0127 obj.y = val; 0128 0129 sx = size(obj.x); 0130 sy = size(obj.y); 0131 if sx(1) == 1 && sy(1) ~= 1 0132 obj.x = obj.x.'; 0133 end 0134 if sx(2) == 1 && sy(2) ~= 1 0135 obj.x = obj.x.'; 0136 end 0137 0138 end 0139 end 0140 0141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0142 % Constructor % 0143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0144 0145 methods 0146 function obj = data2D(varargin) 0147 0148 %%% Call superclass 0149 obj = obj@ltpda_data(varargin{:}); 0150 0151 %%%%%%%%%% Set dafault values %%%%%%%%%% 0152 %%% Exept for a struct as an input 0153 if ~(nargin == 1 && isstruct(varargin{1})) 0154 % set version 0155 obj.prependVersion('$Id: data2D.m,v 1.17 2008/08/25 11:15:53 ingo Exp $'); 0156 end 0157 0158 if nargin == 1 0159 0160 if isstruct(varargin{1}) 0161 %%%%%%%%%% obj = data2D(struct) %%%%%%%%%% 0162 0163 %%% Set properties which are declared in this class 0164 data2D_struct = varargin{1}; 0165 0166 obj.xunits = data2D_struct.xunits; 0167 obj.yunits = data2D_struct.yunits; 0168 obj.x = data2D_struct.x; 0169 obj.y = data2D_struct.y; 0170 end 0171 end 0172 0173 %%% Check the right size of x and y 0174 if ~isempty(obj.x) 0175 if ~isequal(size(obj.x), size(obj.y)) 0176 error('### The x and y containers must be the same size (or x must be empty).'); 0177 end 0178 end 0179 0180 end % End constructor 0181 0182 end 0183 0184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0185 % Methods (public) % 0186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0187 0188 methods 0189 varargout = char(varargin) 0190 varargout = setXunits(varargin) 0191 varargout = setYunits(varargin) 0192 varargout = setX(varargin) 0193 varargout = setY(varargin) 0194 varargout = setXY(varargin) 0195 varargout = getX(varargin) 0196 varargout = getY(varargin) 0197 0198 varargout = applymethod(varargin) 0199 varargout = applyoperator(varargin) 0200 end 0201 0202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0203 % Methods (protected) % 0204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0205 0206 methods (Access = protected) 0207 end 0208 0209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0210 % Methods (public) % 0211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0212 0213 methods 0214 end 0215 0216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0217 % Methods (static) % 0218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0219 0220 methods (Static) 0221 0222 function ii = getInfo(varargin) 0223 ii = utils.helper.generic_getInfo(varargin{:}, 'data2D'); 0224 end 0225 0226 function out = VEROUT() 0227 out = '$Id: data2D.m,v 1.17 2008/08/25 11:15:53 ingo Exp $'; 0228 end 0229 0230 function out = SETS() 0231 out = {}; 0232 end 0233 0234 function out = getDefaultPlist() 0235 out = []; 0236 end 0237 0238 end 0239 0240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0241 % Methods (abstract) % 0242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0243 0244 methods (Static) 0245 end 0246 0247 end 0248