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

 
 

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

Submitted by:  None
Submitted on:  Wed 14 Jan 2015 01:18:49 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: Kai Torben Ohlhus <siko1056>
Originator Name: Edwin de KoningOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.2
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project MemberIn charge of this item.
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:

Kai

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
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

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

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

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 05 Feb 2015 05:35:54 PM UTCsiko1056StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Thu 15 Jan 2015 12:19:43 PM UTCsiko1056StatusFixed=>In Progress
    Thu 15 Jan 2015 12:19:26 PM UTCsiko1056StatusNone=>Fixed
      Assigned toNone=>siko1056
      Operating SystemMicrosoft Windows=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1