octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #43560] interp2 with decreasing inputs and 'li


From: John Hunt
Subject: [Octave-bug-tracker] [bug #43560] interp2 with decreasing inputs and 'linear' method
Date: Sat, 08 Nov 2014 12:43:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0

URL:
  <http://savannah.gnu.org/bugs/?43560>

                 Summary: interp2 with decreasing inputs and 'linear' method
                 Project: GNU Octave
            Submitted by: huntj
            Submitted on: Sat 08 Nov 2014 12:43:12 PM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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
<http://stackoverflow.com/a/26816912/3565696>.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43560>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]