Mercurial > hg > octave-image
changeset 525:819081231fb8
imarithmetics: fixing bug on input check
author | carandraug |
---|---|
date | Sun, 11 Dec 2011 03:30:06 +0000 |
parents | 25b2d4cf36bf |
children | 5750f9aa690a |
files | inst/private/imarithmetics.m |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/inst/private/imarithmetics.m +++ b/inst/private/imarithmetics.m @@ -26,10 +26,8 @@ is_valid = @(x) ((!isnumeric (x) && !islogical (x)) || isempty (x) || issparse (x) || !isreal (x)); - if (is_valid (img)) - error ("%s: first argument must be a numeric or logical, non-empty, non-sparse real matrix", func) - elseif (is_valid (img)) - error ("%s: second argument must be a numeric, non-empty, non-sparse real matrix", func) + if (is_valid (img) || is_valid (val)) + error ("%s: input must be a numeric or logical, non-empty, non-sparse real matrix", func) elseif (!ischar (out_class)) error ("%s: third argument must be a string that specifies the output class", func) endif