Mercurial > octave-nkf
comparison scripts/optimization/fzero.m @ 18132:8ca7b1906a41
fzero.m: Correctly detct if OutputFcn is present (bug #40889).
* fzero.m: Use isempty to check whether OutputFcn is present.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 13 Dec 2013 20:25:48 -0800 |
parents | d63878346099 |
children | 6e0686858b6a |
comparison
equal
deleted
inserted
replaced
18131:c7b68a11074b | 18132:8ca7b1906a41 |
---|---|
300 ## This should never happen. | 300 ## This should never happen. |
301 error ("fzero:bracket", "fzero: zero point is not bracketed"); | 301 error ("fzero:bracket", "fzero: zero point is not bracketed"); |
302 endif | 302 endif |
303 | 303 |
304 ## If there's an output function, use it now. | 304 ## If there's an output function, use it now. |
305 if (outfcn) | 305 if (! isempty (outfcn)) |
306 optv.funccount = nfev; | 306 optv.funccount = nfev; |
307 optv.fval = fval; | 307 optv.fval = fval; |
308 optv.iteration = niter; | 308 optv.iteration = niter; |
309 if (outfcn (x, optv, "iter")) | 309 if (outfcn (x, optv, "iter")) |
310 info = -1; | 310 info = -1; |