rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
merge_model_plot_params.m
1 function merged_plot_params = merge_model_plot_params(model, plot_params)
2 %function merged_plot_params = merge_model_plot_params(model, plot_params)
3 %
4 % function setting some default values in plot_params and copying
5 % fields from model, then from plot_params, hence plot_params
6 % can overload settings in the model.
7 
8 % B. Haasdonk 11.6.2010
9 
10 fieldnames = {'plot',...
11  'plot_slice',...
12  'geometry_transformation',...
13  'xrange',...
14  'yrange',...
15  'geometry_spline_type',...
16  'geometry_transformation_spline_x',...
17  'geometry_transformation_spline_y',...
18  'hill_height',...
19  'post_process',...
20  'gravity',...
21  'clim', ...
22  'range_lim', ...
23  'axis_equal', ...
24  'axis_tight', ...
25  'no_lines'...
26  };
27 
28 merged_plot_params = plot_params;
29 for i = 1:length(fieldnames)
30  fn = fieldnames{i};
31  if isfield(model,fn)
32  merged_plot_params = setfield(merged_plot_params,fn,getfield(model,fn));
33  end;
34  if isfield(plot_params,fn)
35  merged_plot_params = setfield(merged_plot_params,fn,getfield(plot_params,fn));
36  end;
37 end;
38 
39 %| \docupdate