diff m-toolbox/classes/@ssm/modelHelper_checkParameters.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@ssm/modelHelper_checkParameters.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,33 @@
+% 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