


GETX Get the property 'x'.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Get the property 'x'.
CALL: val = obj.getX();
val = obj.getX(idx);
val = obj.getX(1:10);
INPUTS: obj - must be a single data2D object.
idx - index of the data samples
M-FILE INFO: Get information about this methods by calling
>> tsdata.getInfo('getX')
Get information about a specified set-plist by calling:
>> tsdata.getInfo('getX', 'None')
VERSION: $Id: getX.m,v 1.2 2008/08/11 08:40:54 hewitson Exp $
HISTORY: 27-05-2008 Diepholz
Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 % GETX Get the property 'x'. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: Get the property 'x'. 0005 % 0006 % CALL: val = obj.getX(); 0007 % val = obj.getX(idx); 0008 % val = obj.getX(1:10); 0009 % 0010 % INPUTS: obj - must be a single data2D object. 0011 % idx - index of the data samples 0012 % 0013 % M-FILE INFO: Get information about this methods by calling 0014 % >> tsdata.getInfo('getX') 0015 % 0016 % Get information about a specified set-plist by calling: 0017 % >> tsdata.getInfo('getX', 'None') 0018 % 0019 % VERSION: $Id: getX.m,v 1.2 2008/08/11 08:40:54 hewitson Exp $ 0020 % 0021 % HISTORY: 27-05-2008 Diepholz 0022 % Creation 0023 % 0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0025 0026 function varargout = getX(varargin) 0027 0028 %%% Check if this is a call for parameters 0029 if utils.helper.isinfocall(varargin{:}) 0030 varargout{1} = getInfo(varargin{3}); 0031 return 0032 end 0033 0034 obj = varargin{1}; 0035 0036 idx = []; 0037 if nargin > 1 0038 if isnumeric(varargin{2}) || strcmpi(varargin{2}, 'end') 0039 idx = varargin{2}; 0040 else 0041 error('### Unknown arguments to getX.'); 0042 end 0043 end 0044 if isempty(obj.x) && ~isempty(obj.y) 0045 x = 0:1/obj.fs:obj.nsecs-1/obj.fs; %linspace(0, obj.nsecs-1/obj.fs, obj.nsecs*obj.fs); 0046 else 0047 x = obj.x; 0048 end 0049 % transpose x? 0050 sx = size(x); 0051 sy = size(obj.y); 0052 if numel(x) == numel(obj.y) && sx(1) ~= sy(1) 0053 x = x.'; 0054 end 0055 if ~isempty(idx) 0056 if strcmpi(idx, 'end') 0057 x = x(end); 0058 else 0059 x = x(idx); 0060 end 0061 end 0062 0063 varargout{1} = x; 0064 0065 end 0066 0067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0068 % Local Functions % 0069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0070 0071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0072 % 0073 % FUNCTION: getInfo 0074 % 0075 % DESCRIPTION: Get Info Object 0076 % 0077 % HISTORY: 11-07-07 M Hewitson 0078 % Creation. 0079 % 0080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0081 0082 function ii = getInfo(varargin) 0083 if nargin == 1 && strcmpi(varargin{1}, 'None') 0084 sets = {}; 0085 pl = []; 0086 else 0087 sets = {'Default'}; 0088 pl = getDefaultPlist; 0089 end 0090 % Build info object 0091 ii = minfo(mfilename, 'tsdata', '', 'Internal', '$Id: getX.m,v 1.2 2008/08/11 08:40:54 hewitson Exp $', sets, pl); 0092 end 0093 0094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0095 % 0096 % FUNCTION: getDefaultPlist 0097 % 0098 % DESCRIPTION: Get Default Plist 0099 % 0100 % HISTORY: 11-07-07 M Hewitson 0101 % Creation. 0102 % 0103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0104 0105 function plo = getDefaultPlist() 0106 plo = plist(); 0107 end 0108