Mercurial > hg > octave-lojdl
changeset 6227:4c252a611d47
[project @ 2007-01-05 20:23:59 by jwe]
author | jwe |
---|---|
date | Fri, 05 Jan 2007 20:23:59 +0000 |
parents | 984d85191d0d |
children | aa5df9ba98d5 |
files | scripts/optimization/optimset.m |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/optimization/optimset.m +++ b/scripts/optimization/optimset.m @@ -66,10 +66,13 @@ ## to ensure that the field names are expected? old = varargin{1}; new = varargin{2}; + fnames = fieldnames (old); for [val, key] = new - if (! isempty (val)) - old.(key) = val; + mask = strcmpi (fnames, key); + if (any (mask)) + key = fnames (mask); endif + old.(key) = val; endfor retval = old; elseif (rem (nargs, 2) && isstruct (varargin{1}))