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.32 2008/09/03 16:56:21 ingo Exp $ HISTORY: 30-01-2007 Hewitson Creation SEE ALSO: tsdata, fsdata, xydata, cdata, data2D, data3D, xyzdata %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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.32 2008/09/03 16:56:21 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 version = '$Id: xydata.m,v 1.32 2008/09/03 16:56:21 ingo 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 = xydata(varargin) 0094 0095 % Call data2D constructor since we add no special features here. 0096 obj = obj@data2D(varargin{:}); 0097 0098 %%%%%%%%%% Set dafault values %%%%%%%%%% 0099 0100 if nargin == 0 0101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% no input %%%%%%%%%%%%%%%%%%%%%%%%%%%% 0103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0104 0105 elseif nargin == 1 0106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0107 %%%%%%%%%%%%%%%%%%%%%%%%%%%% one input %%%%%%%%%%%%%%%%%%%%%%%%%%%% 0108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0109 0110 if isa(varargin{1}, 'xydata') 0111 %%%%%%%%%% obj = xydata(xydata-object) %%%%%%%%%% 0112 obj = copy(varargin{1}, 1); 0113 0114 elseif isnumeric(varargin{1}) 0115 %%%%%%%%%% obj = xydata(y-vector) %%%%%%%%%% 0116 obj.setY(varargin{1}); 0117 obj.setX(1:length(varargin{1})); 0118 0119 elseif isstruct(varargin{1}) 0120 %%%%%%%%%% data = xydata(struct) %%%%%%%%%% 0121 obj.version = varargin{1}.version; 0122 0123 %%% Do nothing because all values are set in the super class 0124 0125 else 0126 error('### Unknown single argument constructor.'); 0127 end 0128 0129 elseif nargin == 2 0130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0131 %%%%%%%%%%%%%%%%%%%%%%%%%%%% one input %%%%%%%%%%%%%%%%%%%%%%%%%%%% 0132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0133 0134 %%%%%%%%%% obj = xydata(x-vector, y-vector) %%%%%%%%%% 0135 if numel(varargin{1}) == numel(varargin{2}) 0136 obj.setXY(varargin{1}, varargin{2}); 0137 end 0138 0139 else 0140 error('### Unknown two argument constructor.'); 0141 end 0142 end % End constructor 0143 end 0144 0145 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0146 % Methods (public) % 0147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0148 0149 methods 0150 end 0151 0152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0153 % Methods (public) % 0154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0155 0156 methods 0157 varargout = display(varargin); 0158 varargout = copy(varargin) 0159 end 0160 0161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0162 % Methods (protected) % 0163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0164 0165 methods (Access = protected) 0166 end 0167 0168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0169 % Methods (static) % 0170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0171 0172 methods (Static) 0173 varargout = update_struct(varargin); 0174 0175 function out = VEROUT() 0176 out = '$Id: xydata.m,v 1.32 2008/09/03 16:56:21 ingo Exp $'; 0177 end 0178 0179 function ii = getInfo(varargin) 0180 ii = utils.helper.generic_getInfo(varargin{:}, 'xydata'); 0181 end 0182 0183 function out = SETS() 0184 out = {'Default'}; 0185 end 0186 0187 function out = getDefaultPlist(set) 0188 switch set 0189 case 'Default' 0190 out = plist(); 0191 otherwise 0192 error('### Unknown set [%s]', set'); 0193 end 0194 end 0195 0196 end 0197 0198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0199 % Methods (abstract) % 0200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0201 0202 methods (Abstract) 0203 end 0204 0205 end 0206