bugGNU Octave - Bugs: bug #44002, The "extrap" option does...

 
 

bug #44002: The "extrap" option does not work in interp3 function.

Submitter:  None
Submitted:  Wed 14 Jan 2015 01:18:49 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  siko1056
Originator Name:  Edwin de Koning Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.2
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Thu 05 Feb 2015 05:35:54 PM UTC, comment #3: 

Finally I adapted the "extrap" behavior to MATLABs (see 5a59c0e1203d). Except for the "spline" method, one always has to provide a scalar numerical value for extrapolation.

Kai Torben Ohlhus <siko1056>
Group Member
Thu 15 Jan 2015 02:42:44 PM UTC, comment #2: 

It is not only a documentation error.
In Matlab, the default behavior is to extrapolate for values outside the range. Here is the Matlab result:

>> X=[0,0.5,1];Y=X;Z=X;
>> V=rand(3,3,3);
>> x=[-0.1,0,0.1]; y=x;z=x;
>> interp3(X,Y,Z,V,x,y,z,'spline')

ans =
    0.2796    0.8147    0.8973

In Octave the last command would result in a NA for the first answer.


Anonymous
Thu 15 Jan 2015 12:19:26 PM UTC, comment #1: 

Thank you for you bug report. It seems that "extrap" option should be a scalar value. That behavior is also consistent with MATLAB. It is clearly a documentation error and will be fixed with the next release.

So try:


interp3(X,Y,Z,V,x,y,z,"spline",0)

ans =

   0.00000
   0.33127
   0.45983


Kai

Kai Torben Ohlhus <siko1056>
Group Member
Wed 14 Jan 2015 01:18:49 PM UTC, original submission:  

The interp3 function searches for values in a pre-defined list. It has an option to extrapolate the values outside of this list (this is actually the default Matlab behaviour). However, when this option is used, an error is given.

Example:

>> X=[0,0.5,1]; Y=X; Z=X;
>> V=rand(3,3,3);
>> x=[-0.1,0,0.1]; y=x; z=x;
>> interp3(X,Y,Z,V,x,y,z,"spline")

ans =

        NA
   0.26611
   0.26838

(In this case, the default Octave behaviour is to return an "NA" for every outlier. However, I would like to extrapolate the values via the "extrap" option).

>> interp3(X,Y,Z,V,x,y,z,"spline","extrap")

error: interp3: wrong number or incorrectly formatted input arguments
error: called from:
error:   C:\Octave\Octave-3.8.2\share\octave\3.8.2\m\general\interp3.m a
t line 134, column 5

>>


Octave does not accept the "extrap" option in the interp3 function.


Anonymous

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  •  

    Votes

    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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-05 siko1056 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2015-01-15 siko1056 StatusFixed In Progress
    2015-01-15 siko1056 StatusNone Fixed
        Assigned toNone siko1056
        Operating SystemMicrosoft Windows Any

    Back to the top

    Powered by Savane 3.16-1eaf.
    Corresponding source code