octave-maintainers
[Top][All Lists]
Advanced

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

Re: Should interp1.m function allow jumps in X-values?


From: Ben Abbott
Subject: Re: Should interp1.m function allow jumps in X-values?
Date: Tue, 21 Aug 2012 07:04:55 -0400

On Aug 21, 2012, at 4:26 AM, vivek dogra wrote:

> Hello, 
> Currently, interp1.m allows at most one identical pair of values in X.  My 
> concern is should it really do that? My arguments are as follows:
> 
> In my opinion repeated values should not be allowed for interpolation. 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 be:
> 
> 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 another. 
> So Octave should not allow repeated x values.

Is the ambiguity due to a lack of clarity of the documentation, or does 
interp1() not work in a consistent manner?

Ben



reply via email to

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