bugGNU Octave - Bugs: bug #44847, extrapolation not available for...


bug #44847: extrapolation not available for all methods in interp2

Submitter:  Muhali <muhali>
Submitted:  Wed 15 Apr 2015 11:25:47 AM UTC
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Wed 15 Apr 2015 03:46:13 PM UTC, comment #3: 

A parameter EXTRAPVAL is mentioned in the help

"...Note that if EXTRAPVAL is used, METHOD must be specified as well...."

but it is unclear how to use it in the function call, where you only have EXTRAP. Moreover, EXTRAPVAL is never used in the interp2 code itself, but EXTRAP is.

So at least the interp2 documentation is incorrect.

Regarding the linear extrapolation, I mentioned that it used to work until the extrap changeset, so it can easily be revived.

Muhali <muhali>
Wed 15 Apr 2015 03:40:19 PM UTC, comment #2: 

See bug #44002 and the fix for that bug, http://hg.savannah.gnu.org/hgweb/octave/rev/5a59c0e1203d.

My reading of that is that the string argument "extrap" is not a Matlab-compatible option and was removed in favor of making the function compatible.

Someone with better understanding of the functions involved can decide whether this can or can't be implemented while staying Matlab compatible, or whether there is a workaround to use for linear extrapolation instead.

Mike Miller <mtmiller>
Group Member
Wed 15 Apr 2015 03:24:00 PM UTC, comment #1: 

I am not sure I understand the first part of the bug. I ran the following script:

x = y = 1:3;
[xx, yy] = meshgrid (x, y);
zz = xx.^2 + yy.^2;
xi = yi = 0:4;
[xxi, yyi] = meshgrid (xi, yi);
interp2 (xx, yy, zz, xxi, yyi, 'linear', pi)

The borders, where no interpolation was possible, are padded with pi. So the EXTRAPVAL is indeed used as intended.

Now about the reason why extrapolation (using 'extrap' or 'pp' as EXTRAPVAL) are not allowed anymore, I don't know. I marked the bug "feature request" for the latter feature that has been removed.

Pantxo Diribarne <pantxo>
Group Member
Wed 15 Apr 2015 11:25:47 AM UTC, original submission:  

The interp2 documentation mentions the parameter "EXTRAPVAL", but it is actually never used in the code.

Moreover, interp2 used to work with the option "EXTRAP" as a string for any method. I wonder why this is now limited to splines, although e.g. the linear method is much more "tame".

Muhali <muhali>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-15 mtmiller Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        StatusNone Need Info
        Operating SystemGNU/Linux Any
    2015-04-15 pantxo Item GroupNone Feature Request
        Summaryextrap in interp2 extrapolation not available for all methods in interp2
    2015-04-15 pantxo CategoryNone Octave Function

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code