% DOSETPARAMETERS Sets the values of the given parameters.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: DOSETPARAMETERS Sets the values of the given parameters.
%
% CALL:        obj = obj.setParameters({'key1', ...}, [val1, ...]);
%              obj = obj.setParameters(plist);
%              obj = obj.setParameters('key', val);
%
% VERSION: $Id: doSetParameters.m,v 1.2 2011/02/22 15:41:16 hewitson Exp $
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function sys = doSetParameters(sys, setnames, setvalues)
  Nset = numel(setvalues);
  for j=1:Nset
    if ~any(strcmpi(setnames{j}, {sys.params.params.key}))
      warning(['### parameter named ' setnames{j} ' was not found in system ' sys.name])
    else
      sys.params.pset( setnames{j}, setvalues(j) );
    end
  end
  
end

