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

Submitter:  Thorsten Meyer <tmeyier>
Submitted:  Fri 09 Jul 2010 06:34:40 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Thorsten Meyer Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

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

Rik <rik5>
Group 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>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by caliari (Posted a comment)
  • -email is unavailable- added by tmeyier (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-08-05 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code