bugGNU Octave - Bugs: bug #30400, bug of interp2 for small number of...

 
 

bug #30400: bug of interp2 for small number of elements in xi and yi

Submitted by:  Thorsten Meyer <tmeyier>
Submitted on:  Fri 09 Jul 2010 06:34:40 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Thorsten MeyerOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 05 Aug 2010 10:15:09 PM UTC, comment #2:

Fixed in changeset 10859:09144fbb0e36 with suggestion from M. Caliari.

Rik <rik5>
Project Administrator
Tue 27 Jul 2010 02:46:08 PM UTC, comment #1:

Please try replacing

lens = length (cs0);

with

lens = columns (cs0);

in m/general/bicubic.m

Marco

Marco Caliari <caliari>
Project Member
Fri 09 Jul 2010 06:34:40 PM UTC, original submission:

trying a few things in the context of bug #29601, I stumbled across the following strange behaviour:

demo example 7 for interp2 looks like this:
A=[13,-1,12;5,4,3;1,6,2];
x=[0,1,2]; y=[10,11,12];
xi=linspace(min(x),max(x),17);
yi=linspace(min(y),max(y),26)';
mesh(xi,yi,interp2(x,y,A,xi,yi,'cubic'));
[x,y] = meshgrid(x,y);
hold on; plot3(x(:),y(:),A(:),"b*"); hold off;

It works nicely with the present tip. This is also ok:
octave:41> interp2(x,y,A,xi(1:8),yi(1:4),'cubic')
ans =

Columns 1 through 6:

13.000000 9.773438 6.968750 4.585938 2.625000 1.085938
12.212800 9.302787 6.770550 4.616087 2.839400 1.440488
11.451200 8.845838 6.575950 4.641537 3.042600 1.779138
10.715200 8.402587 6.384950 4.662287 3.234600 2.101888

Columns 7 and 8:

-0.031250 -0.726562
0.419350 -0.224012
0.851150 0.258638
1.264150 0.721388

I get a 4 by 8 matrix of interpolated values corresponding to a 4by8 field of value pairs at which to interpolate.

But this is not good:
octave:42> interp2(x,y,A,xi(1:3),yi(1:4),'cubic')
error: bicubic: A(I,J,...) = X: dimensions mismatch
error: called from:
error: /home/thorsten/hg/octave/scripts/general/bicubic.m at line 186, column 12
error: /home/thorsten/hg/octave/scripts/general/interp2.m at line 346, column 12

And this is at least strange:
octave:42> interp2(x,y,A,xi(1),yi(1),'cubic')
ans =

13 13 13 13

Why don't I get only one value for one value pair to be interpolated?

Thorsten Meyer <tmeyier>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by caliari (Posted a comment)
  • -unavailable- added by tmeyier (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 05 Aug 2010 10:15:09 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1