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

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

[Octave-bug-tracker] [bug #65146] griddata - linear interpolation output


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65146] griddata - linear interpolation output errors when number of query points = 3
Date: Tue, 9 Jan 2024 15:32:45 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?65146>

                 Summary: griddata - linear interpolation output errors when
number of query points = 3
                   Group: GNU Octave
               Submitter: nrjank
               Submitted: Tue 09 Jan 2024 03:32:45 PM EST
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 9.0.90
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 09 Jan 2024 03:32:45 PM EST By: Nicholas Jankowski <nrjank>
as identified in bug #65134,  the linear interpolation results appear to be
erroneous depending on the number of input query points. E.g., for a 2d linear
ramp sampled on whole number increments, the of querying any whole number
index should be exactly that increment value. However:


>> abc=[1:10].*[1:10]'
abc =

     1     2     3     4     5     6     7     8     9    10
     2     4     6     8    10    12    14    16    18    20
     3     6     9    12    15    18    21    24    27    30
     4     8    12    16    20    24    28    32    36    40
     5    10    15    20    25    30    35    40    45    50
     6    12    18    24    30    36    42    48    54    60
     7    14    21    28    35    42    49    56    63    70
     8    16    24    32    40    48    56    64    72    80
     9    18    27    36    45    54    63    72    81    90
    10    20    30    40    50    60    70    80    90   100

>> griddata (1:10, 1:10, abc, [1 5], [1 5])
ans =

    1
   25

>> griddata (1:10, 1:10, abc, [1 5 10], [1 5 10])
ans =

    2.0111
       NaN
   89.8889

>> griddata (1:10, 1:10, abc, [1 5 10; 1 5 10], [1 5 10; 1 5 10])
ans =

     1    25   100
     1    25   100


I suspect one of the triangulation/cross/normalization functions is confused
as to which dimension it should operate on when n=3. (e.g., when left
unspecified, I believe cross looks for the first length 3 dimension). if so it
might be a simple matter of adding a dim argument to one of those function
calls.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65146>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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