rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
change_mu.m
1 function model = change_mu(model, mu_mod)
2 %function model = change_mu(model, mu_mod)
3 %
4 % function changing the parameter vector mu in the model struct
5 %
6 % input:
7 % mu_mod = modification of the mu_vector
8 % mu_mod = [10, 0, -4, ...] means, mu_1 is incremented by 10, mu_2
9 % is stays unchanged, mu_3 is decremented by 4, ...
10 %
11 % required fields of model:
12 % mu_names : cell array of strings, indicating the fields, which are set
13 % by the current routine
14 %
15 % Oliver Zeeb, 14.02.11
16 
17 if length(mu_mod(:))~=length(model.mu_names)
18  error('dimensionality of mu does not fit to model.mu_names');
19 end;
20 
21 for i=1:length(mu_mod(:))
22  model.(model.mu_names{i}) = model.(model.mu_names{i}) + mu_mod(i);
23 % if (model.(model.mu_names{i}) < model.mu_ranges{i}(1) ...
24 % || model.(model.mu_names{i}) > model.mu_ranges{i}(2))
25 % warning('parameter out of range');
26 % end
27 end;
28