[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extrapolate forbidden with interp1, spline
From: |
David Bateman |
Subject: |
Re: extrapolate forbidden with interp1, spline |
Date: |
Tue, 27 Nov 2007 11:41:45 +0100 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Eric Chassande-Mottin wrote:
> hi,
>
> I just wanted to mention that the extrapolation
> (of a point outside the support of the input data set)
> is *not* allowed using interp1() with opt "spline" in GNU
> Octave, while it is in the corporate world.
>
> see:
>
> octave:1> interp1([1 2 3 4],[1 2 3 4],-1,'spline')
> ans = NA
>
> interp1 is the user-defined function from the file
> /usr/share/octave/2.9.14/m/general/interp1.m
>
>
>>> interp1([1 2 3 4],[1 2 3 4],-1,'spline')
>>>
>
> ans =
>
> -1
>
> perhaps the way to solve this incompatibility
> is to invite the use of the 'extrap' opt with a warning
>
> octave:22> interp1([1 2 3 4],[1 2 3 4],-1,'extrap')
> ans = -1
>
>
This is a bug in matlab, as extrapolation should only be done if the
"extrap" flag is given..
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary