https://github.com/Data2Dynamics/d2d
Tip revision: 83d6eedd5f6c33ae94dbce6c4e620d2f1bb57b1f authored by Joep Vanlier on 09 April 2015, 08:41:55 UTC
Forgot to update C version number
Forgot to update C version number
Tip revision: 83d6eed
arSaveFit.m
function arSaveFit(name)
global ar
if(~isfield(ar, 'fit_hist'))
ar.fit_hist = struct([]);
j = 1;
else
j = length(ar.fit_hist) + 1;
end
if(nargin==0)
name = ar.config.optimizers{ar.config.optimizer};
if(ar.config.optimizer==5)
tmpnames = arNLS;
name = [name '_' tmpnames{ar.config.optimizerStep+1}];
end
addname = input(sprintf('enter name addition [%s_...]: ', name), 's');
if(~isempty(addname))
name = [name '_' addname];
end
end
ar.fit_hist(j).hist = ar.fit;
ar.fit_hist(j).optimizer = ar.config.optimizer;
if(ar.config.optimizer==5)
ar.fit_hist(j).optimizerStep = ar.config.optimizerStep;
else
ar.fit_hist(j).optimizerStep = nan;
end
ar.fit_hist(j).config = ar.config.optim;
ar.fit_hist(j).name = name;
[~,imin] = min(ar.fit.chi2_hist + ar.fit.constr_hist);
ar.fit_hist(j).p = ar.fit.p_hist(imin,:);