comparison m-toolbox/classes/@ssm/doSetParameters.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % DOSETPARAMETERS Sets the values of the given parameters.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: DOSETPARAMETERS Sets the values of the given parameters.
5 %
6 % CALL: obj = obj.setParameters({'key1', ...}, [val1, ...]);
7 % obj = obj.setParameters(plist);
8 % obj = obj.setParameters('key', val);
9 %
10 % VERSION: $Id: doSetParameters.m,v 1.2 2011/02/22 15:41:16 hewitson Exp $
11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
14 function sys = doSetParameters(sys, setnames, setvalues)
15 Nset = numel(setvalues);
16 for j=1:Nset
17 if ~any(strcmpi(setnames{j}, {sys.params.params.key}))
18 warning(['### parameter named ' setnames{j} ' was not found in system ' sys.name])
19 else
20 sys.params.pset( setnames{j}, setvalues(j) );
21 end
22 end
23
24 end
25