Mercurial > hg > octave-lyh
diff scripts/optimization/optimset.m @ 8596:8833c0b18eb2
enable default settings queries in optim funcs
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 27 Jan 2009 08:15:08 +0100 |
parents | eeaee297c0da |
children | 11cf7bc4a871 |
line wrap: on
line diff
--- a/scripts/optimization/optimset.m +++ b/scripts/optimization/optimset.m @@ -52,10 +52,9 @@ elseif (nargs == 1 && ischar (varargin{1})) ## Return defaults for named function. fcn = varargin{1}; - optfcn = sprintf ("__%s_defopts__", fcn); - if (exist (optfcn)) - retval = optimset (struct (), feval (optfcn)); - else + try + retval = feval (fcn, 'defaults'); + catch error ("no defaults for function `%s'", fcn); endif elseif (nargs == 2 && isstruct (varargin{1}) && isstruct (varargin{2}))