


CDATA is the constant data class.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: CDATA is the constant data class.
SUPER CLASSES: ltpda_data
SUB CLASSES:
PROPERTIES:
Protected Properties (read only)
xunits - units of the x-axis
yunits - units of the y-axis
x - a cell-array of strings, intended to label each data point in y
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
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
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.41 2008/08/15 11:45:19 ingo Exp $
HISTORY: 09-06-2008 Hewitson
Creation.
SEE ALSO: ltpda_obj, ao, miir, mfir, specwin, timespan, pzmodel, history, ssm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


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 % xunits - units of the x-axis 0014 % yunits - units of the y-axis 0015 % x - a cell-array of strings, intended to label each data point in y 0016 % y - a matrix of data samples 0017 % 0018 % CDATA METHODS: 0019 % 0020 % Defined Abstract methods: 0021 % char - returns one character string which represents the object 0022 % copy - copies an object 0023 % display - displays an object 0024 % update_struct - updates a object structure to the current tbx-version 0025 % 0026 % Public Methods 0027 % setXunits - set the property 'xunits' 0028 % setYunits - set the property 'yunits' 0029 % setX - set the property 'x' 0030 % setY - set the property 'y' 0031 % setXY - set the property 'x' and 'y' 0032 % getX - get the property 'x' 0033 % getY - get the property 'y' 0034 % applymethod - applys the given method to the input 2D data 0035 % applyoperator - applys the given operator to the two input data objects 0036 % 0037 % M-FILE INFO: The following call returns an minfo object that contains 0038 % information about the cdata constructor: 0039 % >> info = cdata.getInfo 0040 % or >> info = cdata.getInfo('cdata') 0041 % 0042 % You can get information about class methods by calling: 0043 % >> info = cdata.getInfo(method) 0044 % e.g. >> info = cdata.getInfo('eq') 0045 % 0046 % You can also restrict the sets of parameters contained in 0047 % the minfo object by calling: 0048 % >> info = cdata.getInfo(method, set) 0049 % e.g. >> info = cdata.getInfo('cdata', 'Default') 0050 % 0051 % VERSION: $Id: cdata.m,v 1.41 2008/08/15 11:45:19 ingo Exp $ 0052 % 0053 % HISTORY: 09-06-2008 Hewitson 0054 % Creation. 0055 % 0056 % SEE ALSO: ltpda_obj, ao, miir, mfir, specwin, timespan, pzmodel, history, ssm 0057 % 0058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0059 0060 classdef cdata < ltpda_data 0061 0062 0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0064 % Property definition % 0065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0066 0067 %---------- Public (read/write) Properties ---------- 0068 properties 0069 end 0070 0071 %---------- Protected read-only Properties ---------- 0072 properties (SetAccess = protected) 0073 xunits = sym('empty'); 0074 yunits = sym('empty'); 0075 x = {}; 0076 y = []; 0077 end 0078 0079 %---------- Private Properties ---------- 0080 properties (GetAccess = protected, SetAccess = protected) 0081 end 0082 0083 %---------- Abstract Properties ---------- 0084 properties (Abstract = true, SetAccess = protected) 0085 end 0086 0087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0088 % Check property setting % 0089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0090 0091 methods 0092 function obj = set.xunits(obj, val) 0093 if ~isa(val, 'sym') 0094 error('### The value for the property ''xunits'' must be a symbolic-object'); 0095 end 0096 obj.xunits = val; 0097 end 0098 function obj = set.yunits(obj, val) 0099 if ~isa(val, 'sym') 0100 error('### The value for the property ''yunits'' must be a symbolic-object'); 0101 end 0102 obj.yunits = val; 0103 end 0104 function obj = set.x(obj, val) 0105 if ~iscell(val) || ndims(val) ~= 2 0106 error('### The value for the property ''x'' must be a cell-array of strings'); 0107 end 0108 obj.x = val; 0109 end 0110 function obj = set.y(obj, val) 0111 if ~isnumeric(val) || ndims(val) ~= 2 0112 error('### The value for the property ''y'' must be a numeric matrix'); 0113 end 0114 obj.y = val; 0115 end 0116 end 0117 0118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0119 % Constructor % 0120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0121 0122 methods 0123 function obj = cdata(varargin) 0124 0125 %%% Call superclass 0126 obj = obj@ltpda_data(varargin{:}); 0127 0128 %%%%%%%%%% Set dafault values %%%%%%%%%% 0129 %%% Exept for a struct as an input 0130 if ~(nargin == 1 && isstruct(varargin{1})) 0131 % set version 0132 obj.setVersion('$Id: cdata.m,v 1.41 2008/08/15 11:45:19 ingo Exp $'); 0133 end 0134 0135 if nargin == 0 0136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0137 %%%%%%%%%%%%%%%%%%%%%%%%%%%% no inputs %%%%%%%%%%%%%%%%%%%%%%%%%%%% 0138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0139 0140 elseif nargin == 1 0141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0142 %%%%%%%%%%%%%%%%%%%%%%%%%%%% one input %%%%%%%%%%%%%%%%%%%%%%%%%%%% 0143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0144 0145 if isa(varargin{1}, 'cdata') 0146 %%%%%%%%%% Copy ltpda_obj Object %%%%%%%%%% 0147 %%%%%%%%%% data = cdata(cdata-object) %%%%%%%%%% 0148 obj = copy(varargin{1}, 1); 0149 0150 elseif isstruct(varargin{1}) 0151 %%%%%%%%%% data = cdata(struct) %%%%%%%%%% 0152 %%% Set properties which are declared in this class 0153 obj.xunits = varargin{1}.xunits; 0154 obj.yunits = varargin{1}.yunits; 0155 obj.x = varargin{1}.x; 0156 obj.y = varargin{1}.y; 0157 0158 elseif isnumeric(varargin{1}) 0159 %%%%%%%%%% data = cdata(data- vector, matrix) %%%%%%%%%% 0160 obj = obj.setY(varargin{1}); 0161 else 0162 error('### Unknown single argument constructor.'); 0163 end 0164 elseif nargin == 2 0165 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0166 %%%%%%%%%%%%%%%%%%%%%%%%%%%% two input %%%%%%%%%%%%%%%%%%%%%%%%%%%% 0167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0168 0169 %%%%%%%%%% data = cdata(tag, data -vector -matrix) %%%%%%%%%% 0170 % data2D(x,y) 0171 obj.setXY(varargin{1},varargin{2}); 0172 else 0173 error('### Unknown number of arguments.'); 0174 end 0175 0176 % Check the x and y agree 0177 if ~isempty(obj.x) 0178 if ~isequal(size(obj.x), size(obj.y)) 0179 error('### The x and y containers must be the same size (or x must be empty).'); 0180 end 0181 end 0182 0183 end % End constructor 0184 0185 end 0186 0187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0188 % Methods (public) % 0189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0190 0191 methods 0192 varargout = char(varargin) 0193 varargout = copy(varargin) 0194 0195 varargout = setXunits(varargin) 0196 varargout = setYunits(varargin) 0197 varargout = setX(varargin) 0198 varargout = setY(varargin) 0199 varargout = setXY(varargin) 0200 varargout = getX(varargin) 0201 varargout = getY(varargin) 0202 end 0203 0204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0205 % Methods (protected) % 0206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0207 0208 methods (Access = protected) 0209 0210 end 0211 0212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0213 % Methods (public) % 0214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0215 0216 methods 0217 end 0218 0219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0220 % Methods (static) % 0221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0222 0223 methods (Static) 0224 varargout = update_struct(varargin); 0225 0226 function out = VEROUT() 0227 out = '$Id: cdata.m,v 1.41 2008/08/15 11:45:19 ingo Exp $'; 0228 end 0229 0230 function ii = getInfo(varargin) 0231 ii = utils.helper.generic_getInfo(varargin{:}, 'cdata'); 0232 end 0233 0234 function out = SETS() 0235 out = {'Default'}; 0236 end 0237 0238 function out = getDefaultPlist(set) 0239 switch set 0240 case 'Default' 0241 out = plist(); 0242 otherwise 0243 error('### Unknown set [%s]', set'); 0244 end 0245 end 0246 0247 end 0248 0249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0250 % Methods (abstract) % 0251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0252 0253 methods (Abstract) 0254 end 0255 0256 end 0257