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

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

[Octave-bug-tracker] [bug #61863] interp2 gives wrong results for comple


From: Christof Kaufmann
Subject: [Octave-bug-tracker] [bug #61863] interp2 gives wrong results for complex matrices
Date: Wed, 19 Jan 2022 20:55:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

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

                 Summary: interp2 gives wrong results for complex matrices
                 Project: GNU Octave
            Submitted by: christofkaufmann
            Submitted on: Thu 20 Jan 2022 01:55:17 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

Interpolating complex matrices gives a default extrapolation value of NA + 0i
instead of NA + NAi. Example:

> interp2 (i*eye(2), 0:1, 1)
ans =

    NA +   0i     0 +   1i


Additionally "pchip" gives wrong results for the imaginary part:

> interp2(i*eye(2), 1.25, 1, "pchip")
ans =       0 + 0.8438i

while it should give:

interp2(eye(2), 1.25, 1, "pchip") * i
ans =       0 + 0.7500i


The appended patch fixes interp2 for complex matrices.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 20 Jan 2022 01:55:17 AM UTC  Name: interp2_fix_complex1.diff  Size:
2KiB   By: christofkaufmann
Fix interp2 for complex matrices - v1
<http://savannah.gnu.org/bugs/download.php?file_id=52692>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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