Home > classes > @plist > nparams.m

nparams

PURPOSE ^

NPARAMS returns the number of param objects in the list.

SYNOPSIS ^

function varargout = nparams(varargin)

DESCRIPTION ^

 NPARAMS returns the number of param objects in the list.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: NPARAMS returns the number of param objects in the list.

 CALL:        n = nparams(plist)

 M-FILE INFO: Get information about this methods by calling
              >> plist.getInfo('nparams')

              Get information about a specified set-plist by calling:
              >> plist.getInfo('nparams', 'set')

 VERSION:     $Id: nparams.m,v 1.10 2008/09/04 15:29:31 ingo Exp $

 HISTORY:     30-01-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % NPARAMS returns the number of param objects in the list.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: NPARAMS returns the number of param objects in the list.
0005 %
0006 % CALL:        n = nparams(plist)
0007 %
0008 % M-FILE INFO: Get information about this methods by calling
0009 %              >> plist.getInfo('nparams')
0010 %
0011 %              Get information about a specified set-plist by calling:
0012 %              >> plist.getInfo('nparams', 'set')
0013 %
0014 % VERSION:     $Id: nparams.m,v 1.10 2008/09/04 15:29:31 ingo Exp $
0015 %
0016 % HISTORY:     30-01-2007 M Hewitson
0017 %                 Creation
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 function varargout = nparams(varargin)
0022 
0023   %%% Check if this is a call for parameters
0024   if utils.helper.isinfocall(varargin{:})
0025     varargout{1} = getInfo(varargin{3});
0026     return
0027   end
0028 
0029   objs = utils.helper.collect_objects(varargin(:), 'plist');
0030 
0031   n = [];
0032   for ii = 1:numel(objs)
0033     n = [n length(objs(ii).params)];
0034   end
0035 
0036   varargout{1} = n;
0037 end
0038 
0039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0040 %                               Local Functions                               %
0041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0042 
0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0044 %
0045 % FUNCTION:    getInfo
0046 %
0047 % DESCRIPTION: Get Info Object
0048 %
0049 % HISTORY:     11-07-07 M Hewitson
0050 %                Creation.
0051 %
0052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0053 
0054 function ii = getInfo(varargin)
0055   if nargin == 1 && strcmpi(varargin{1}, 'None')
0056     sets = {};
0057     pl   = [];
0058   else
0059     sets = {'Default'};
0060     pl   = getDefaultPlist;
0061   end
0062   % Build info object
0063   ii = minfo(mfilename, 'plist', '', utils.const.categories.helper, '$Id: nparams.m,v 1.10 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0064 end
0065 
0066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0067 %
0068 % FUNCTION:    getDefaultPlist
0069 %
0070 % DESCRIPTION: Get Default Plist
0071 %
0072 % HISTORY:     11-07-07 M Hewitson
0073 %                Creation.
0074 %
0075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0076 
0077 function plo = getDefaultPlist()
0078   plo = plist();
0079 end
0080

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003