Should interp1.m function allow jumps in X-values?
From:
vivek dogra
Subject:
Should interp1.m function allow jumps in X-values?
Date:
Tue, 21 Aug 2012 13:56:47 +0530
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.