Mercurial > hg > ltpda
diff m-toolbox/classes/@pest/fromValues.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@pest/fromValues.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,44 @@ +% FROMVALUES construct a pest object from different values. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% FUNCTION: fromValues +% +% DESCRIPTION: Construct a pest object from different values. +% +% CALL: pe = fromValues(pe, pli) +% +% PARAMETER: pe - empty pest object +% pli - input plist +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function obj = fromValues(obj, pli) + + VERSION = '$Id: fromValues.m,v 1.6 2011/08/16 05:16:32 hewitson Exp $'; + + % get pzmodel info + ii = pest.getInfo('pest', 'From Values'); + + % Set the method version string in the minfo object + ii.setMversion([VERSION '-->' ii.mversion]); + + % Combine input plist with default values + pl = applyDefaults(ii.plists, pli); + + % get values + obj.y = pl.find('y'); + obj.names = pl.mfind('paramNames', 'names', 'params'); + obj.dy = pl.find('dy'); + obj.cov = pl.find('cov'); + obj.corr = pl.find('corr'); + obj.chi2 = pl.find('chi2'); + obj.dof = pl.find('dof'); + obj.models = pl.find('models'); + obj.pdf = pl.find('pdf'); + + % Add history + obj.addHistory(ii, pl, [], []); + + % Set object properties + obj.setObjectProperties(pl); + +end