Mercurial > forge
changeset 8715:3ed012a0f558 octave-forge
deriv: more input checks, also check if it's numeric and not only scalar
author | carandraug |
---|---|
date | Mon, 31 Oct 2011 16:59:24 +0000 |
parents | b6a3df90365b |
children | a9a4b8737f9a |
files | main/optim/inst/deriv.m |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/main/optim/inst/deriv.m Mon Oct 31 16:58:07 2011 +0000 +++ b/main/optim/inst/deriv.m Mon Oct 31 16:59:24 2011 +0000 @@ -32,9 +32,9 @@ error ("Not enough arguments."); elseif (!isa (f, 'function_handle')) error ("The first argument 'f' must be a function handle."); - elseif (!isscalar (x0)) + elseif (!isscalar (x0) || !isnumeric (x0)) error ("The second argument 'x0' must be a scalar."); - elseif (!isscalar (h)) + elseif (!isscalar (h) || !isnumeric (h)) error ("The third argument 'h' must be a scalar."); elseif (!isscalar (O) || !isnumeric (O)) error ("The fourth argument 'O' must be a scalar.");