comparison m-toolbox/classes/@data2D/data2D.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % DATA2D is the abstract base class for 2-dimensional data objects.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: DATA2D is the base class for 2-dimensional data objects. This is
5 % an abstract class.
6 %
7 % SUPER CLASSES: ltpda_data < ltpda_nuo < ltpda_obj
8 %
9 % VERSION: $Id: data2D.m,v 1.34 2011/03/30 13:15:00 mauro Exp $
10 %
11 % SEE ALSO: ltpda_data, fsdata, tsdata, xydata, data3D
12 %
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 classdef (Hidden = true) data2D < ltpda_data
16
17
18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 % Property definition %
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21
22 %---------- Public (read/write) Properties ----------
23 properties (GetAccess = public, SetAccess = public)
24 xunits = unit; % units of the x-axis
25 x = []; % data values of the x-axis
26 dx = []; % error on x values
27 end
28
29 %---------- Protected read-only Properties ----------
30 properties (GetAccess = public, SetAccess = protected)
31 end
32
33 %---------- Private Properties ----------
34 properties (GetAccess = protected, SetAccess = protected)
35 end
36
37 %---------- Abstract Properties ----------
38 properties (Abstract = true, SetAccess = protected)
39 end
40
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 % Check property setting %
43 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44
45 methods
46 %--- Xunits
47 function set.xunits(obj, val)
48 if ~ischar(val) && ~isa(val, 'unit')
49 error('### The value for the property ''xunits'' must be a unit-object');
50 end
51 if ischar(val)
52 obj.xunits = unit(val);
53 elseif isa(val, 'unit')
54 obj.xunits = val;
55 else
56 error('### The xunits value must be a unit or a string');
57 end
58 end
59 %--- X
60 function set.x(obj, val)
61 if ~isempty(val)
62 if ~isnumeric(val) || ~isvector(val)
63 error('### The value for the property ''x'' must be a numeric vector');
64 end
65 end
66 obj.x = val;
67
68 sx = size(obj.x);
69 sy = size(obj.y);
70 if sx(1) == 1 && sy(1) ~= 1
71 obj.x = obj.x.';
72 end
73 if sx(2) == 1 && sy(2) ~= 1
74 obj.x = obj.x.';
75 end
76 end
77 %--- dX
78 function set.dx(obj, val)
79 if ~isempty(val)
80 if ~isnumeric(val) || ~(numel(val) == 0 || numel(val) == 1 || numel(val) == numel(obj.y))
81 error('### The value for the property ''dx'' must have the length 0, 1 or the length of the y-values');
82 end
83 end
84 obj.dx = val;
85
86 sdx = size(obj.dx);
87 sy = size(obj.y);
88 if sdx(1) == 1 && sy(1) ~= 1
89 obj.dx = obj.dx.';
90 end
91 if sdx(2) == 1 && sy(2) ~= 1
92 obj.dx = obj.dx.';
93 end
94 end
95 end
96
97 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98 % Constructor %
99 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100
101 methods
102 function obj = data2D(varargin)
103 end
104 end
105
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 % Methods (public) %
108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109
110 methods
111 end
112
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
114 % Methods (protected) %
115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116
117 methods (Access = protected)
118 varargout = fromStruct(varargin)
119 varargout = fromDom(varargin)
120 end
121
122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
123 % Methods (private) %
124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125
126 methods (Access = private)
127 end
128
129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
130 % Methods (static) %
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132
133 methods (Static)
134
135 function ii = getInfo(varargin)
136 ii = utils.helper.generic_getInfo(varargin{:}, 'data2D');
137 end
138
139 function out = VEROUT()
140 out = '$Id: data2D.m,v 1.34 2011/03/30 13:15:00 mauro Exp $';
141 end
142
143 function out = SETS()
144 out = {};
145 end
146
147 function out = getDefaultPlist()
148 out = [];
149 end
150
151 end
152
153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 % Methods (abstract) %
155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156
157 methods (Static)
158 end
159
160 end
161