Home > classes > @cdata > getX.m

getX

PURPOSE ^

GETX Get the property 'x'.

SYNOPSIS ^

function varargout = getX(varargin)

DESCRIPTION ^

 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 cdata 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.1 2008/08/04 17:02:02 ingo Exp $

 HISTORY:     27-05-2008 Diepholz
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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 cdata 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.1 2008/08/04 17:02:02 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   %%% get x values
0047   if isempty(idx)
0048     varargout{1} = x;
0049   else
0050     if isempty(x)
0051       x = cell(size(varargin{1}.y));
0052       for ii=1:numel(x), x{ii} = ''; end
0053     end
0054     varargout{1} = x(idx);
0055   end
0056 end
0057 
0058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0059 %                               Local Functions                               %
0060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0061 
0062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0063 %
0064 % FUNCTION:    getInfo
0065 %
0066 % DESCRIPTION: Get Info Object
0067 %
0068 % HISTORY:     11-07-07 M Hewitson
0069 %                Creation.
0070 %
0071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0072 
0073 function ii = getInfo(varargin)
0074   if nargin == 1 && strcmpi(varargin{1}, 'None')
0075     sets = {};
0076     pl   = [];
0077   else
0078     sets = {'Default'};
0079     pl   = getDefaultPlist;
0080   end
0081   % Build info object
0082   ii = minfo(mfilename, 'cdata', '', 'Internal', '$Id: getX.m,v 1.1 2008/08/04 17:02:02 ingo Exp $', sets, pl);
0083 end
0084 
0085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0086 %
0087 % FUNCTION:    getDefaultPlist
0088 %
0089 % DESCRIPTION: Get Default Plist
0090 %
0091 % HISTORY:     11-07-07 M Hewitson
0092 %                Creation.
0093 %
0094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0095 
0096 function plo = getDefaultPlist()
0097   plo = plist();
0098 end
0099

Generated on Wed 27-Aug-2008 13:30:29 by m2html © 2003