# HG changeset patch # User Vivek Dogra # Date 1345206150 14400 # Node ID 2d5e4d283688243cfe3337de8085ab6f3b43bdfc # Parent 8367f326fa29204dfe0f59f3cdbf86253364003c Modified interp1.m file to check whether X has distinct values or not. diff --git a/doc/interpreter/contributors.in b/doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in +++ b/doc/interpreter/contributors.in @@ -48,6 +48,7 @@ Bill Denney Fabian Deutsch Christos Dimitrakakis +Vivek Dogra David M. Doolin Carnë Draug Pascal A. Dupuis diff --git a/scripts/general/interp1.m b/scripts/general/interp1.m --- a/scripts/general/interp1.m +++ b/scripts/general/interp1.m @@ -168,6 +168,11 @@ y = y(p,:); endif + ## check whether sample point @var{x} are distinct; give error if not. + if (any (diff (x) == 0)) + error ("interp1: X should have distinct values"); + endif + starmethod = method(1) == "*"; if (starmethod)