Mercurial > hg > ltpda
comparison m-toolbox/classes/@xydata/xydata.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 % XYDATA X-Y data object class constructor. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: XYDATA X-Y data object class constructor. | |
5 % Create an X-Y data object. | |
6 % | |
7 % SUPER CLASSES: data2D < ltpda_data < ltpda_nuo < ltpda_obj | |
8 % | |
9 % Constructors: | |
10 % xy = xydata() - creates a blank xy-data object | |
11 % xy = xydata(y) - creates an xy data object with the given | |
12 % y-data. | |
13 % xy = xydata(x,y) - creates an xy-data object with the given | |
14 % (x,y)-data. | |
15 % | |
16 % VERSION: $Id: xydata.m,v 1.51 2011/03/30 13:17:33 mauro Exp $ | |
17 % | |
18 % SEE ALSO: tsdata, fsdata, xydata, cdata, data2D, data3D, xyzdata | |
19 % | |
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
21 | |
22 classdef (Hidden = true) xydata < data2D | |
23 | |
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
25 % Property definition % | |
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
27 | |
28 %---------- Public (read/write) Properties ---------- | |
29 properties | |
30 end | |
31 | |
32 %---------- Protected read-only Properties ---------- | |
33 properties (GetAccess = public, SetAccess = protected) | |
34 end | |
35 | |
36 %---------- Private Properties ---------- | |
37 properties (GetAccess = protected, SetAccess = protected) | |
38 end | |
39 | |
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
41 % Check property setting % | |
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
43 | |
44 methods | |
45 end | |
46 | |
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
48 % Constructor % | |
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
50 | |
51 methods | |
52 function obj = xydata(varargin) | |
53 | |
54 switch nargin | |
55 case 0 | |
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%% no input %%%%%%%%%%%%%%%%%%%%%%%%%%% | |
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
59 | |
60 case 1 | |
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
62 %%%%%%%%%%%%%%%%%%%%%%%%%%% one input %%%%%%%%%%%%%%%%%%%%%%%%%%% | |
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
64 | |
65 if isa(varargin{1}, 'xydata') | |
66 %%%%%%%%%% obj = xydata(xydata-object) %%%%%%%%%% | |
67 obj = copy(varargin{1}, 1); | |
68 | |
69 elseif isnumeric(varargin{1}) | |
70 %%%%%%%%%% obj = xydata(y-vector) %%%%%%%%%% | |
71 obj.setY(varargin{1}); | |
72 obj.setX(1:length(varargin{1})); | |
73 | |
74 elseif isstruct(varargin{1}) | |
75 %%%%%%%%%% data = xydata(struct) %%%%%%%%%% | |
76 obj = fromStruct(obj, varargin{1}); | |
77 | |
78 else | |
79 error('### Unknown single argument constructor.'); | |
80 end | |
81 | |
82 case 2 | |
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
84 %%%%%%%%%%%%%%%%%%%%%%%%%%% two input %%%%%%%%%%%%%%%%%%%%%%%%%%% | |
85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
86 | |
87 if isa(varargin{1}, 'org.apache.xerces.dom.DeferredElementImpl') && ... | |
88 isa(varargin{2}, 'history') | |
89 %%%%%%%%%% obj = xydata(DOM node, history-objects) %%%%%%%%%% | |
90 obj = fromDom(obj, varargin{1}, varargin{2}); | |
91 | |
92 elseif numel(varargin{1}) == numel(varargin{2}) | |
93 %%%%%%%%%% obj = xydata(x-vector, y-vector) %%%%%%%%%% | |
94 obj.setXY(varargin{1}, varargin{2}); | |
95 | |
96 else | |
97 error('### Unknown two argument constructor.'); | |
98 end | |
99 | |
100 otherwise | |
101 error('### Unknown number of constructor arguments.'); | |
102 end | |
103 end % End constructor | |
104 end % End public methods | |
105 | |
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
107 % Methods (Public, hidden) % | |
108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
109 | |
110 methods (Hidden = true) | |
111 varargout = attachToDom(varargin) | |
112 end | |
113 | |
114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
115 % Methods (protected) % | |
116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
117 | |
118 methods (Access = protected) | |
119 varargout = fromStruct(varargin) | |
120 varargout = fromDom(varargin) | |
121 end | |
122 | |
123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
124 % Methods (private) % | |
125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
126 | |
127 methods (Access = private) | |
128 end | |
129 | |
130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
131 % Methods (static) % | |
132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
133 methods (Static) | |
134 | |
135 function out = VEROUT() | |
136 out = '$Id: xydata.m,v 1.51 2011/03/30 13:17:33 mauro Exp $'; | |
137 end | |
138 | |
139 function ii = getInfo(varargin) | |
140 ii = utils.helper.generic_getInfo(varargin{:}, 'xydata'); | |
141 end | |
142 | |
143 function out = SETS() | |
144 out = {'Default'}; | |
145 end | |
146 | |
147 function out = getDefaultPlist(set) | |
148 switch lower(set) | |
149 case 'default' | |
150 out = plist(); | |
151 otherwise | |
152 error('### Unknown set [%s]', set'); | |
153 end | |
154 end | |
155 | |
156 function obj = initObjectWithSize(n,m) | |
157 obj = xydata.newarray([n m]); | |
158 end | |
159 | |
160 end % End static methods | |
161 | |
162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
163 % Methods (static, private) % | |
164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
165 | |
166 methods (Static, Access = private) | |
167 end % End static, private methods | |
168 | |
169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
170 % Methods (static, hidden) % | |
171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
172 | |
173 methods (Static = true, Hidden = true) | |
174 varargout = loadobj(varargin) | |
175 varargout = update_struct(varargin); | |
176 end | |
177 | |
178 end % End classdef |