comparison scripts/optimization/fminunc.m @ 13027:b9a89ca0fb75

prevent optimization functions from setting ans in workspace at startup * fminbnd.m, fminunc.m, fsolve.m, fzero.m, lsqnonneg.m, pqpnonneg.m, qp.m: Discard result from call to __all_opt__ in PKG_ADD command.
author John W. Eaton <jwe@octave.org>
date Mon, 29 Aug 2011 13:07:22 -0400
parents f5a780d675a1
children 63463570d9fe
comparison
equal deleted inserted replaced
13026:9a2a6054460f 13027:b9a89ca0fb75
75 ## Note: If you only have a single nonlinear equation of one variable, using 75 ## Note: If you only have a single nonlinear equation of one variable, using
76 ## @code{fminbnd} is usually a much better idea. 76 ## @code{fminbnd} is usually a much better idea.
77 ## @seealso{fminbnd, optimset} 77 ## @seealso{fminbnd, optimset}
78 ## @end deftypefn 78 ## @end deftypefn
79 79
80 ## PKG_ADD: __all_opts__ ("fminunc"); 80 ## PKG_ADD: ## Discard result to avoid polluting workspace with ans at startup.
81 ## PKG_ADD: [~] = __all_opts__ ("fminunc");
81 82
82 function [x, fval, info, output, grad, hess] = fminunc (fcn, x0, options = struct ()) 83 function [x, fval, info, output, grad, hess] = fminunc (fcn, x0, options = struct ())
83 84
84 ## Get default options if requested. 85 ## Get default options if requested.
85 if (nargin == 1 && ischar (fcn) && strcmp (fcn, 'defaults')) 86 if (nargin == 1 && ischar (fcn) && strcmp (fcn, 'defaults'))