view m-toolbox/classes/@ssm/modelHelper_checkParameters.m @ 35:4be5f7a5316f
database-connection-manager
Suppress output messages on preferences loading and saving
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − % MODELHELPER_CHECKPARAMETERS compare the user requested parameter names to
+ − % the model parameter names.
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % DESCRIPTION: MODELHELPER_CHECKPARAMETERS compare the user requested parameter names to
+ − % the model parameter names.
+ − %
+ − % CALL: pl = modelHelper_checkParameters(pl, defaultPlist)
+ − %
+ − % INPUTS:
+ − % 'pl' - the user plist
+ − % 'paramNames' - the model's parameter plist
+ − %
+ − % OUTPUTS:
+ − %
+ − % 'pl' - plist of model parameters.
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − function pl = modelHelper_checkParameters(pl, modelname, paramNames)
+ −
+ − setNames = pl.find('param names');
+ −
+ − for kk=1:numel(setNames)
+ −
+ − pname = setNames{kk};
+ −
+ − if ~ismember(pname, paramNames)
+ − warning('Model %s does not contain a parameter <%s>', modelname, pname);
+ − end
+ −
+ − end
+ −
+ − end