bugGNU Octave - Bugs: bug #43418, ...

 
 

bug #43418: interp2(X,Y,Z,iX,iZ,"spline") fails when iX,iZ are matrices

Submitted by:  Malte Hinrichs <maldje>
Submitted on:  Tue 14 Oct 2014 06:52:14 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: Malte HinrichsOpen/Closed: Open
Release: 3.8.0Operating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Fri 16 Dec 2016 07:39:53 PM UTC, comment #6:

This issue is still present in Octave 4.2.0.

When I run the script from comment #3, then I still get an error message from Octave, where as Matlab is reported to run fine on this script.

Hartmut <hardy>
Wed 26 Nov 2014 10:35:17 AM UTC, comment #5:

I found a workaround using interpn instead of interp2. I also discovered a bug in interpn when using spline-interpolation, which I will report separately.

I have included an example file: test_interp2c.m

In short the workaround is:

iZ is initialized to the correct format first, because spline-interpolation only works correctly with vector-input. With matrices it delivers incorrect results:

(file #32546)

Malte Hinrichs <maldje>
Wed 12 Nov 2014 08:11:24 PM UTC, comment #4:

Marking the bug as confirmed.

Rik <rik5>
Project Administrator
Wed 12 Nov 2014 07:16:05 PM UTC, comment #3:

Please excuse the delay. I did not have access to matlab before today. I modified the script for matlab-compatibility (test_interp2b.m)

It works fine in matlab but not in octave. In my opinion this confirms the bug.

XI and YI do not need to be in mesh grid format. Only X,Y,Z do.

Also linear interpolation works fine in octave. The bug only concerns spline interpolation.

(file #32424)

Malte Hinrichs <maldje>
Mon 03 Nov 2014 11:12:13 PM UTC, comment #2:

Do you have access to Matlab to test how it behaves? The error message is pretty specific

and happens to be true. iPHI and iR are definitely not in meshgrid format.

The Matlab documentation just describes the data being in meshgrid format, but I can't tell whether this is also true of the requested interpolation range as well.

Rik <rik5>
Project Administrator
Tue 14 Oct 2014 07:16:38 PM UTC, comment #1:

Forget about the first example file. It contains an error. Use this one.

(file #32273)

Malte Hinrichs <maldje>
Tue 14 Oct 2014 06:52:14 PM UTC, original submission:

The Summary says it all. The same is true for interpn.

Please check out the attached file.
It illustrates the problem and includes a workaround.

Cheers,

Malte

Malte Hinrichs <maldje>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #32546:  test_interp2c.m added by maldje (1KiB - application/octet-stream - workaround with interpn)
file #32424:  test_interp2b.m added by maldje (827B - application/octet-stream - modified and bug fixed for matlab)
file #32273:  test_interp2.m added by maldje (708B - application/octet-stream - corrected example file)
file #32272:  test_interp2.m added by maldje (518B - application/octet-stream - test file for interp2)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hardy (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by maldje (Submitted the item)
  •  

    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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 26 Nov 2014 10:35:17 AM UTCmaldjeAttached File-=>Added test_interp2c.m, #32546
    Wed 12 Nov 2014 08:11:24 PM UTCrik5Item GroupIncorrect Result=>Matlab Compatibility
      StatusNeed Info=>Confirmed
    Wed 12 Nov 2014 07:16:05 PM UTCmaldjeAttached File-=>Added test_interp2b.m, #32424
    Wed 05 Nov 2014 02:26:20 AM UTCrik5StatusNone=>Need Info
    Tue 14 Oct 2014 07:16:38 PM UTCmaldjeAttached File-=>Added test_interp2.m, #32273
    Tue 14 Oct 2014 06:52:14 PM UTCmaldjeAttached File-=>Added test_interp2.m, #32272

    Back to the top


    Powered by Savane 3.1-cleanup1