bugGNU Octave - Bugs: bug #62209, interpn: Incorrect results for...

 
 

bug #62209: interpn: Incorrect results for certain choices of input

Submitter:  Adam <adam_a>
Submitted:  Mon 21 Mar 2022 09:32:40 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  adam_a Open/Closed:  * Closed
Release:  * 6.4.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 22 Mar 2022 08:56:26 AM UTC, comment #3: 

Ah, my mistake.  Thank you.

Adam <adam_a>
Tue 22 Mar 2022 07:35:46 AM UTC, comment #2: 

Thanks anonymous.

Closing as invalid.

Markus Mützel <mmuetzel>
Group administrator
Tue 22 Mar 2022 07:18:34 AM UTC, comment #1: 

Not a bug. From interpn help:

The parameters Y1, Y2, ..., YN represent the points at which the
array VI is interpolated. They can be vectors of the same length
and orientation in which case they are interpreted as coordinates
of scattered points. If they are vectors of differing orientation
or length, they are used to form a grid in "ndgrid" format. They
can also be N-dimensional arrays of equal size.

Try transposing one of your inputs to (1:n)' and that will work.

Anonymous
Mon 21 Mar 2022 09:32:40 PM UTC, original submission:  

I'm getting incorrect results when using interpn in version 6.4.0.  Example code is below.


x = rand(10,10,10);
y = interpn( 1:10 , 1:10 , 1:10 , x , 1:0.5:10 , 1:0.25:10 , 1:0.5:10 );
size(y)


This correctly returns:  [ 19   37   19 ]


y = interpn( 1:10 , 1:10 , 1:10 , x , 1:0.5:10 , 1:0.5:10 , 1:0.5:10 );
size(y)


The size of y ought to be:  [ 19   19   19 ]
Instead, the size returned is:   [ 1   19 ]

Can anyone confirm whether this is repeatable please?

Adam <adam_a>

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by adam_a (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
    2022-03-22 mmuetzel StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code