[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: Vivek
Subject: [Octave-bug-tracker] [bug #36732] interp1 does not check input for monotonicity
Date: Fri, 17 Aug 2012 16:35:20 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1

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

In my opinion repeated values should not be allowed for interpolation, let me
explain it with an example: Let's say i have following data points:

 x  f(x)
0    4
1    6 
2    8
3    10

Now if i want to get f(1.5) then i will take the value midway between f(1) and
f(2) which would be 7. Now in case i have repeated values the data points will

x   f(x)
0    4
1    6
1    7  
2    8 
3   10

Now in this case what f(1.5) will be? 7 or 7.5? (What will you call the best
interpolation?) There will be ambiguity in this case. Also in the present case
the sample points are nicely behaving so there is not much difference between
7 and 7.5. Although in some cases (if let's say f(1) = 6 and f(1) = 9) there
can be lot of difference between answers when we choose one data point over
So I guess, either octave should not allow repeated x values or it should
generate some warning (I don't know what the warning would be?).

With regards,


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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