Commit 081cf816 authored by matecellab's avatar matecellab
Browse files

added option to rebuild with alternative parameters

parent 75b5765a
function bas_rebuildFEM(basil)
function bas_rebuildFEM(basil, aparam)
%
% bas_rebuilFEM(basil)
% bas_rebuilFEM(basil, aparam)
%
% Looks for basil<basilid>_modelparam.m in the working directory, loads the
% existing model parameters, and runs bas_buildFEM(basilid,param) if the
% file exists.
% Parameters supplied with the argument aparam will overwrite the
% parameters in param in basil<basilid>_modelparam.m
%
% See also bas_buildFEM
......@@ -12,7 +14,15 @@ for b = 1:numel(basil)
paramname = sprintf('basil%i_modelparam.m',basil(b));
if exist(paramname,'file')
% reload model parameters
eval(sprintf('run %s',paramname))
eval(sprintf('run %s',paramname));
if nargin > 1
fn = fieldnames(aparam);
% loop over parameters to update
for f = 1:size(fn,1)
param.(fn{f}) = aparam.(fn{f});
end
end
% rebuild the model
bas_buildFEM(basil(b),param)
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment