# HG changeset patch # User Rik # Date 1427693816 25200 # Node ID 185e8dbdaa40435b8eb76a78841420bbad85a8aa # Parent 8395925230529af8998a53482cc79e0cfba8a582 Allow logical arguments to stem() function (bug #44659). * __stem__.m: Use isnumeric and islogical to validate inputs to stem function. diff --git a/scripts/plot/draw/private/__stem__.m b/scripts/plot/draw/private/__stem__.m --- a/scripts/plot/draw/private/__stem__.m +++ b/scripts/plot/draw/private/__stem__.m @@ -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