changeset 9176:4b9998d43c9a octave-forge

imarithmetics: fixing bug on input check
author carandraug
date Sun, 11 Dec 2011 03:30:06 +0000
parents 49f69874df97
children 28c58459a4ee
files main/image/inst/private/imarithmetics.m
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/main/image/inst/private/imarithmetics.m	Sat Dec 10 23:36:58 2011 +0000
+++ b/main/image/inst/private/imarithmetics.m	Sun Dec 11 03:30:06 2011 +0000
@@ -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