Mercurial > octave
changeset 33329:5bc48a35b792
maint: merge stable to default
author | Rik <rik@octave.org> |
---|---|
date | Thu, 04 Apr 2024 18:23:26 -0700 |
parents | 3f3d7dde7f61 (current diff) 87a54302d126 (diff) |
children | d7f1aae5be0f |
files | scripts/optimization/fminsearch.m |
diffstat | 1 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/nonlin.txi Thu Apr 04 15:46:33 2024 -0400 +++ b/doc/interpreter/nonlin.txi Thu Apr 04 18:23:26 2024 -0700 @@ -197,32 +197,32 @@ the function, @code{F}, being minimized. E.g., @w{@code{F = F(x, C)}}. Octave's minimizer functions are designed to only pass one optimization variable to @code{F}, but parameter passing can be accomplished by defining -an @ref{Anonymous Function} that contains the necessargy parameter(s). See +an @ref{Anonymous Functions} that contains the necessary parameter(s). See the example below: +@example @group -@example A = 2; B = 3; -f = @(x) sin (A*x + B); +f = @@(x) sin (A*x + B); fminbnd (f, 0, 2) -@result 0.8562 +@result{} 0.8562 +@end group @end example -@end group Note that anonymous functions retain the value of parameters at the time they are defined. Changing a parameter value after function definition will not affect output of the function until it is redefined: +@example @group -@example B = 4; fminbnd (f, 0, 2) -@result 0.8562 -f = @(x) sin (A*x + B); +@result{} 0.8562 +f = @@(x) sin (A*x + B); fminbnd (f, 0, 2) -@result 0.3562 +@result{} 0.3562 +@end group @end example -@end group The function @code{humps} is a useful function for testing zero and extrema finding functions.