rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
set_mu_default.m
1 function model = set_mu_default(model,mu,dummy)
2 %function model = set_mu_default(model,mu)
3 %
4 % function setting the parameter vector mu in the model struct
5 % required fields of model:
6 % mu_names : cell array of strings, indicating the fields, which are set
7 % by the current routine
8 %
9 % parameters:
10 % mu : new parameter vector `\mu`
11 
12 % Bernard Haasdonk 20.7.2006
13 
14 if nargin == 2
15  dummy = 0;
16 end
17 
18 if nargout == 0
19  warning('set_mu called without return argument!');
20 end
21 
22 if length(mu(:))~=length(model.mu_names)
23  error('dimensionality of mu does not fit to model.mu_names');
24 end;
25 
26 for i=1:length(mu(:))
27  model.(model.mu_names{i}) = mu(i);
28 end;
29