Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_data/ltpda_data.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 % LTPDA_DATA is the abstract base class for ltpda data objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: LTPDA_DATA is the base class for ltpda data objects. | |
5 % This is an abstract class. | |
6 % | |
7 % SUPERCLASSES: ltpda_nuo < ltpda_obj | |
8 % | |
9 % VERSION: $Id: ltpda_data.m,v 1.19 2011/03/25 15:33:52 mauro Exp $ | |
10 % | |
11 % SEE ALSO: data2D, ltpda_nuo, ltpda_obj, cdata | |
12 % | |
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
14 | |
15 classdef (Hidden = true) ltpda_data < ltpda_nuo | |
16 | |
17 | |
18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
19 % Property definition % | |
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
21 | |
22 %---------- Public (read/write) Properties ---------- | |
23 properties (GetAccess = public, SetAccess = public) | |
24 yunits = unit; % units of the y-axis | |
25 y = []; % data values of the y-axis | |
26 dy = []; % error on y 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 %--- Yunits | |
47 function set.yunits(obj, val) | |
48 if ~ischar(val) && ~isa(val, 'unit') | |
49 error('### The value for the property ''yunits'' must be a unit-object or a string'); | |
50 end | |
51 if ischar(val) | |
52 obj.yunits = unit(val); | |
53 elseif isa(val, 'unit') | |
54 obj.yunits = val; | |
55 else | |
56 error('### The yunits value must be a unit or a string'); | |
57 end | |
58 end | |
59 %--- Y | |
60 function set.y(obj, val) | |
61 if ~isempty(val) | |
62 if ~(isnumeric(val) || islogical(val)) || ndims(val) ~= 2 | |
63 error('### The value for the property ''y'' must be a matric or a vector'); | |
64 end | |
65 end | |
66 if ~isempty(obj.y) && isvector(obj.y) && ((size(val,1) == 1 && size(obj.y,1) ~= 1) || (size(val,2) == 1 && size(obj.y,2) ~= 1)) | |
67 val = val.'; | |
68 end | |
69 obj.y = val; | |
70 | |
71 if ~isempty(findprop(obj,'x')) | |
72 sx = size(obj.x); | |
73 sy = size(obj.y); | |
74 if sx(1) == 1 && sy(1) ~= 1 | |
75 obj.x = obj.x.'; | |
76 end | |
77 if sx(2) == 1 && sy(2) ~= 1 | |
78 obj.x = obj.x.'; | |
79 end | |
80 end | |
81 end | |
82 %--- dY | |
83 function set.dy(obj, val) | |
84 if ~isempty(val) | |
85 if ~isnumeric(val) || ~(numel(val) == 0 || numel(val) == 1 || numel(val) == numel(obj.y)) | |
86 error('### The value for the property ''dy'' must have the length 0, 1 or the length of the y-values'); | |
87 end | |
88 end | |
89 obj.dy = val; | |
90 | |
91 sdy = size(obj.dy); | |
92 sy = size(obj.y); | |
93 if sdy(1) == 1 && sy(1) ~= 1 | |
94 obj.dy = obj.dy.'; | |
95 end | |
96 if sdy(2) == 1 && sy(2) ~= 1 | |
97 obj.dy = obj.dy.'; | |
98 end | |
99 end | |
100 end | |
101 | |
102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
103 % Constructor % | |
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
105 | |
106 methods | |
107 | |
108 function obj = ltpda_data(varargin) | |
109 end | |
110 | |
111 end | |
112 | |
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
114 % Methods (public) % | |
115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
116 | |
117 methods | |
118 end | |
119 | |
120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
121 % Methods (protected) % | |
122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
123 | |
124 methods (Access = protected) | |
125 varargout = fromStruct(varargin) | |
126 varargout = fromDom(varargin) | |
127 end | |
128 | |
129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
130 % Methods (private) % | |
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
132 | |
133 methods (Access = private) | |
134 end | |
135 | |
136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
137 % Methods (static) % | |
138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
139 | |
140 methods (Static) | |
141 | |
142 function ii = getInfo(varargin) | |
143 ii = utils.helper.generic_getInfo(varargin{:}, 'ltpda_data'); | |
144 end | |
145 | |
146 function out = VEROUT() | |
147 out = '$Id: ltpda_data.m,v 1.19 2011/03/25 15:33:52 mauro Exp $'; | |
148 end | |
149 | |
150 function out = SETS() | |
151 out = {}; | |
152 end | |
153 | |
154 function out = getDefaultPlist() | |
155 out = []; | |
156 end | |
157 | |
158 end | |
159 | |
160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
161 % Methods (abstract) % | |
162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
163 | |
164 methods (Abstract) | |
165 end | |
166 | |
167 end | |
168 |