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: Ed Meyer
Subject: Re: Should interp1.m function allow jumps in X-values?
Date: Tue, 21 Aug 2012 08:55:23 -0700



On Tue, Aug 21, 2012 at 8:00 AM, Juan Pablo Carbajal <address@hidden> wrote:
On Tue, Aug 21, 2012 at 4:51 PM, Martin Helm <address@hidden> wrote:
> Am 21.08.2012 16:35, schrieb Juan Pablo Carbajal:
>> interp1 calculates an interpolant, so it should either ignore the
>> repeated values or give an error.
> It is explicitly mentioned in the help that:
> Duplicate points in X specify a discontinuous interpolant.
>
> So it should not give a warning when used as it is explicitly intended
> to be used.

You are right. Then I fail to understand the problem posed.
If X is sorted then the two interpolants (the right and the left one)
are well defined.

--
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/

If we accept that discontinuous interpolation is a legitimate thing
to do and is triggered by duplicate x values then it seems to me
the only thing left to decide is how to sort unsorted data - increasing
or decreasing.  Increasing is more natural.

It appears from the doc that the original intent was to allow discontinuous
data for linear interpolation but the author was thinking about allowing it for
all types, which is a legitimate goal.

The last change to interp1.m (disallowing duplicate x values) means it
no longer passes one of the tests and does not follow the original intent
or the manual.

--
Ed Meyer


reply via email to

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