Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@data2D/data2D.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,161 @@ +% DATA2D is the abstract base class for 2-dimensional data objects. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: DATA2D is the base class for 2-dimensional data objects. This is +% an abstract class. +% +% SUPER CLASSES: ltpda_data < ltpda_nuo < ltpda_obj +% +% VERSION: $Id: data2D.m,v 1.34 2011/03/30 13:15:00 mauro Exp $ +% +% SEE ALSO: ltpda_data, fsdata, tsdata, xydata, data3D +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +classdef (Hidden = true) data2D < ltpda_data + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Property definition % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %---------- Public (read/write) Properties ---------- + properties (GetAccess = public, SetAccess = public) + xunits = unit; % units of the x-axis + x = []; % data values of the x-axis + dx = []; % error on x values + end + + %---------- Protected read-only Properties ---------- + properties (GetAccess = public, SetAccess = protected) + end + + %---------- Private Properties ---------- + properties (GetAccess = protected, SetAccess = protected) + end + + %---------- Abstract Properties ---------- + properties (Abstract = true, SetAccess = protected) + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Check property setting % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + methods + %--- Xunits + function set.xunits(obj, val) + if ~ischar(val) && ~isa(val, 'unit') + error('### The value for the property ''xunits'' must be a unit-object'); + end + if ischar(val) + obj.xunits = unit(val); + elseif isa(val, 'unit') + obj.xunits = val; + else + error('### The xunits value must be a unit or a string'); + end + end + %--- X + function set.x(obj, val) + if ~isempty(val) + if ~isnumeric(val) || ~isvector(val) + error('### The value for the property ''x'' must be a numeric vector'); + end + end + obj.x = val; + + sx = size(obj.x); + sy = size(obj.y); + if sx(1) == 1 && sy(1) ~= 1 + obj.x = obj.x.'; + end + if sx(2) == 1 && sy(2) ~= 1 + obj.x = obj.x.'; + end + end + %--- dX + function set.dx(obj, val) + if ~isempty(val) + if ~isnumeric(val) || ~(numel(val) == 0 || numel(val) == 1 || numel(val) == numel(obj.y)) + error('### The value for the property ''dx'' must have the length 0, 1 or the length of the y-values'); + end + end + obj.dx = val; + + sdx = size(obj.dx); + sy = size(obj.y); + if sdx(1) == 1 && sy(1) ~= 1 + obj.dx = obj.dx.'; + end + if sdx(2) == 1 && sy(2) ~= 1 + obj.dx = obj.dx.'; + end + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Constructor % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + methods + function obj = data2D(varargin) + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Methods (public) % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + methods + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Methods (protected) % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + methods (Access = protected) + varargout = fromStruct(varargin) + varargout = fromDom(varargin) + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Methods (private) % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + methods (Access = private) + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Methods (static) % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + methods (Static) + + function ii = getInfo(varargin) + ii = utils.helper.generic_getInfo(varargin{:}, 'data2D'); + end + + function out = VEROUT() + out = '$Id: data2D.m,v 1.34 2011/03/30 13:15:00 mauro Exp $'; + end + + function out = SETS() + out = {}; + end + + function out = getDefaultPlist() + out = []; + end + + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Methods (abstract) % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + methods (Static) + end + +end +