# HG changeset patch
# User Vivek Dogra <vivek.dogra.iitd@gmail.com>
# Date 1345057735 -19800
# Node ID 2c985a4cffb78b76648943dc219946cd8ef05b73
# Parent  3b8275fed4dd9ba65e1ce1347850b4ea405859a1
Modified interp1.m file to check whether X has distinct values or not.

diff -r 3b8275fed4dd -r 2c985a4cffb7 scripts/general/interp1.m
--- a/scripts/general/interp1.m	Wed Aug 15 08:33:03 2012 -0700
+++ b/scripts/general/interp1.m	Thu Aug 16 00:38:55 2012 +0530
@@ -168,6 +168,12 @@
     y = y(p,:);
   endif
 
+ ## check whether sample point @var{x} are distinct; give error if not.
+  d = diff(x);
+  if (any(d == 0))
+    error ("interp1: X should have distinct values");
+  endif
+
   starmethod = method(1) == "*";
 
   if (starmethod)
