


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
>> fsdata.getInfo('getX')
Get information about a specified set-plist by calling:
>> fsdata.getInfo('getX', 'None')
VERSION: $Id: getX.m,v 1.2 2008/08/14 10:27:54 ingo 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 % >> fsdata.getInfo('getX') 0015 % 0016 % Get information about a specified set-plist by calling: 0017 % >> fsdata.getInfo('getX', 'None') 0018 % 0019 % VERSION: $Id: getX.m,v 1.2 2008/08/14 10:27:54 ingo 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 %%% get idx 0035 idx = []; 0036 if nargin == 2 0037 if isnumeric(varargin{2}) 0038 idx = varargin{2}; 0039 else 0040 error('### Unknown arguments to getX.'); 0041 end 0042 end 0043 0044 x = varargin{1}.x; 0045 0046 %%% transpose x? 0047 sx = size(x); 0048 sy = size(varargin{1}.y); 0049 if numel(x) == numel(varargin{1}.y) && sx(1) ~= sy(1) 0050 x = x.'; 0051 end 0052 0053 %%% get x values 0054 if isempty(idx) 0055 varargout{1} = x; 0056 else 0057 varargout{1} = x(idx); 0058 end 0059 end 0060 0061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0062 % Local Functions % 0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0064 0065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0066 % 0067 % FUNCTION: getInfo 0068 % 0069 % DESCRIPTION: Get Info Object 0070 % 0071 % HISTORY: 11-07-07 M Hewitson 0072 % Creation. 0073 % 0074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0075 0076 function ii = getInfo(varargin) 0077 if nargin == 1 && strcmpi(varargin{1}, 'None') 0078 sets = {}; 0079 pl = []; 0080 else 0081 sets = {'Default'}; 0082 pl = getDefaultPlist; 0083 end 0084 % Build info object 0085 ii = minfo(mfilename, 'data2D', '', 'Internal', '$Id: getX.m,v 1.2 2008/08/14 10:27:54 ingo Exp $', sets, pl); 0086 end 0087 0088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0089 % 0090 % FUNCTION: getDefaultPlist 0091 % 0092 % DESCRIPTION: Get Default Plist 0093 % 0094 % HISTORY: 11-07-07 M Hewitson 0095 % Creation. 0096 % 0097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0098 0099 function plo = getDefaultPlist() 0100 plo = plist(); 0101 end 0102