bugGNU Octave - Bugs: bug #43560, interp2 with decreasing inputs and...

 
 

bug #43560: interp2 with decreasing inputs and 'linear' method

Submitter:  John Hunt <huntj>
Submitted:  Sat 08 Nov 2014 12:43:12 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 16 Dec 2016 10:29:42 PM UTC, comment #1: 

This issue might be FIXED in Octave 4.2.0.

When I run the script from comment #0 then I get the following result:

zi__ =

  -3  -4
  -4  -5

It does not contain any NaNs any more. And the result is the very same as with the options "cubic" or "spline" instead of "linear".

Hartmut <hardy>
Sat 08 Nov 2014 12:43:12 PM UTC, original submission:  

interp2 problems with decreasing inputs yield NA when "linear" method is used. This is similar to bug #36351: interp2 run from high to low. With 'cubic' or 'spline' the problem does not occur.

Here is a code sample displaying the problem.


x_ = [-1.5 -2.5];
y_ = [-1 -2 -3];
[x__, y__] = meshgrid(x_, y_);
z__ = x__ + y__;

xi_ = x_;
yi_ = x_;

[xi__, yi__] = meshgrid(xi_, yi_);
zi__ = interp2(x__, y__, z__, xi__, yi__, "linear")


Which yields


zi__ =

    -3    NA
    -4    NA


Either the documentation should specify that x and y should be increasing, or the sort performed for 'linear' method also.

Meanwhile, a workaround can be found here.

John Hunt <huntj>

 

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

Attach Files:
   
   
Comment:
   

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 hardy (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by huntj (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-01 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed
    2015-02-22 mtmiller CategoryNone Octave Function
        Item GroupNone Incorrect Result

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code