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.4 2008/09/04 15:29:30 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.4 2008/09/04 15:29:30 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 % return always a column vector 0047 if size(x,1) == 1 0048 x = x.'; 0049 end 0050 0051 % %%% transpose x? 0052 % sx = size(x); 0053 % sy = size(varargin{1}.y); 0054 % if numel(x) == numel(varargin{1}.y) && sx(1) ~= sy(1) 0055 % x = x.'; 0056 % end 0057 0058 %%% get x values 0059 if isempty(idx) 0060 varargout{1} = x; 0061 else 0062 varargout{1} = x(idx); 0063 end 0064 end 0065 0066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0067 % Local Functions % 0068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0069 0070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0071 % 0072 % FUNCTION: getInfo 0073 % 0074 % DESCRIPTION: Get Info Object 0075 % 0076 % HISTORY: 11-07-07 M Hewitson 0077 % Creation. 0078 % 0079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0080 0081 function ii = getInfo(varargin) 0082 if nargin == 1 && strcmpi(varargin{1}, 'None') 0083 sets = {}; 0084 pl = []; 0085 else 0086 sets = {'Default'}; 0087 pl = getDefaultPlist; 0088 end 0089 % Build info object 0090 ii = minfo(mfilename, 'data2D', '', utils.const.categories.internal, '$Id: getX.m,v 1.4 2008/09/04 15:29:30 ingo Exp $', sets, pl); 0091 end 0092 0093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0094 % 0095 % FUNCTION: getDefaultPlist 0096 % 0097 % DESCRIPTION: Get Default Plist 0098 % 0099 % HISTORY: 11-07-07 M Hewitson 0100 % Creation. 0101 % 0102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0103 0104 function plo = getDefaultPlist() 0105 plo = plist(); 0106 end 0107