[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #36732] interp1 does not check input for monot

From: Ben Abbott
Subject: [Octave-bug-tracker] [bug #36732] interp1 does not check input for monotonicity
Date: Sun, 19 Aug 2012 22:09:55 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25

Follow-up Comment #33, bug #36732 (project octave):

It goes immediately after sorting X.

diff --git a/scripts/general/interp1.m b/scripts/general/interp1.m
--- a/scripts/general/interp1.m
+++ b/scripts/general/interp1.m
@@ -169,7 +169,7 @@
  ## check whether sample point @var{x} are distinct; give error if not.
-  if (any (diff (x) == 0))
+  if (any ((diff (x(1:(end-1))) == 0) & (diff (x(2:end)) == 0)))
     error ("interp1: X should have distinct values");


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]