changeset 21560:96c768d898f0

Use stricter input validation for ezplot N, DOM inputs (bug #46952). * __ezplot__.m: Only allow DOM or N to be set once.
author Rik <rik@octave.org>
date Tue, 29 Mar 2016 21:10:16 -0700
parents 6619945e4434
children 4abcc0969ebd
files scripts/plot/draw/private/__ezplot__.m
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__ezplot__.m	Tue Mar 29 08:16:09 2016 -0700
+++ b/scripts/plot/draw/private/__ezplot__.m	Tue Mar 29 21:10:16 2016 -0700
@@ -250,14 +250,14 @@
       circ = true;
     elseif (ischar (arg) && strcmp (arg, "animate"))
       animate = true;
-    elseif (isscalar (arg))
+    elseif (isscalar (arg) && (n == 60 || n == 500))
       n = arg;
-    elseif (numel (arg) == 2)
+    elseif (numel (arg) == 2 && isempty (domain))
       domain = [arg(1) arg(2) arg(1) arg(2)];
-    elseif (numel (arg) == 4)
+    elseif (numel (arg) == 4 && isempty (domain))
       domain = arg(:).';
     else
-      error ("%s: expecting scalar N or 2-, 4-element vector DOM", ezfunc);
+      error ("%s: expecting scalar N, or 2-/4-element vector DOM", ezfunc);
     endif
   endwhile