changeset 20030:185e8dbdaa40

Allow logical arguments to stem() function (bug #44659). * __stem__.m: Use isnumeric and islogical to validate inputs to stem function.
author Rik <rik@octave.org>
date Sun, 29 Mar 2015 22:36:56 -0700
parents 839592523052
children 10392528396c
files scripts/plot/draw/private/__stem__.m
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__stem__.m	Sun Mar 29 22:05:23 2015 -0700
+++ b/scripts/plot/draw/private/__stem__.m	Sun Mar 29 22:36:56 2015 -0700
@@ -239,7 +239,9 @@
         y = repmat ([1:nr]', 1, nc);
       endif
     endif
-    if (! (isnumeric (x) && isnumeric (y) && isnumeric (z)))
+    if (! (isnumeric (x) || islogical (x))
+        || ! (isnumeric (y) || islogical (y))
+        || ! (isnumeric (z) || islogical (z)))
       error ("stem3: X, Y, and Z must be numeric");
     endif
   else
@@ -250,7 +252,8 @@
         x = 1:rows (y);
       endif
     endif
-    if (! (isnumeric (x) && isnumeric (y)))
+    if (! (isnumeric (x) || islogical (x))
+        || ! (isnumeric (y) || islogical (y)))
       error ("stem: X and Y must be numeric");
     endif
   endif